InputRollScale
InputRollScale
#Overview
name: InputRollScale
The value of this variable can be defined or overridden in .ini config files. 2
.ini config files referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of InputRollScale is to scale the roll input for player movement and camera control in Unreal Engine 5. It is part of the input system and specifically affects the roll axis of rotation.
This setting variable is primarily used in the Engine module, particularly within the GameFramework subsystem. It is referenced in the PlayerController and Pawn classes, which are fundamental components of the game’s input and character control systems.
The value of this variable is typically set through the PlayerController class. There are getter and setter methods (GetDeprecatedInputRollScale and SetDeprecatedInputRollScale) available for manipulating this value, although they are marked as deprecated in UE5.
InputRollScale interacts with other input-related variables, such as InputYawScale and InputPitchScale, which together form the legacy input scale system. It’s also closely related to the bEnableLegacyInputScales flag in the InputSettings class.
Developers must be aware that this variable is part of a deprecated input system. As of Unreal Engine 5, it’s recommended to use the Enhanced Input plugin’s Scalar Modifier instead of these legacy input scales.
Best practices when using this variable include:
- Avoiding its use in new projects and migrating existing projects to the Enhanced Input system.
- If it must be used, ensure that the bEnableLegacyInputScales flag is set to true in the InputSettings.
- Be cautious when modifying this value, as it can significantly affect the feel of player control and camera movement.
- Consider using the BlueprintCallable functions for getting and setting this value to maintain consistency across your project.
- When adding roll input in code, use the AddRollInput function on the PlayerController, which automatically applies this scale.
Remember that as this system is deprecated, it may be removed in future engine versions, so planning for migration to the Enhanced Input system is advisable for long-term project maintenance.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseGame.ini:171, section: [/Script/Engine.PlayerController]
- INI Section:
/Script/Engine.PlayerController
- Raw value:
1.0
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:11, section: [/Script/LyraGame.LyraPlayerController]
- INI Section:
/Script/LyraGame.LyraPlayerController
- Raw value:
1.0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/InputSettings.h:57
Scope (from outer to inner):
file
class class UInputSettings : public UObject
Source code excerpt:
uint8 bCaptureMouseOnLaunch:1;
/** Enable the use of legacy input scales on the player controller (InputYawScale, InputPitchScale, and InputRollScale) */
UPROPERTY(config, EditAnywhere, Category = "Input")
uint8 bEnableLegacyInputScales:1;
/**
* If set to false, then the player controller's InputMotion function will never be called.
* This will effectively disable any motion input (tilt, rotation, acceleration, etc) on
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/Pawn.h:524
Scope: file
Source code excerpt:
/**
* Add input (affecting Roll) to the Controller's ControlRotation, if it is a local PlayerController.
* This value is multiplied by the PlayerController's InputRollScale value.
* @param Val Amount to add to Roll. This value is multiplied by the PlayerController's InputRollScale value.
* @see PlayerController::InputRollScale
*/
UFUNCTION(BlueprintCallable, Category="Pawn|Input", meta=(Keywords="addroll"))
ENGINE_API virtual void AddControllerRollInput(float Val);
/** Helper to see if move input is ignored. If our controller is a PlayerController, checks Controller->IsMoveInputIgnored(). */
UFUNCTION(BlueprintCallable, Category="Pawn|Input")
ENGINE_API virtual bool IsMoveInputIgnored() const;
UFUNCTION(BlueprintCallable, Category = "Pawn|Input")
ENGINE_API TSubclassOf<UInputComponent> GetOverrideInputComponentClass() const;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:528
Scope: file
Source code excerpt:
ENGINE_API float GetDeprecatedInputPitchScale() const;
/** A getter for the deprecated InputRollScale property. This should only be used if UInputSettings::bEnableLegacyInputScales is turned on. */
UE_DEPRECATED(5.0, "GetDeprecatedInputRollScale is deprecated, please use the Enhanced Input plugin Scalar Modifier instead.)")
UFUNCTION(BlueprintCallable, Category = PlayerController)
ENGINE_API float GetDeprecatedInputRollScale() const;
/** A getter for the deprecated InputYawScale property. This should only be used if UInputSettings::bEnableLegacyInputScales is turned on. */
UE_DEPRECATED(5.0, "SetDeprecatedInputYawScale is deprecated, please use the Enhanced Input plugin Scalar Modifier instead.")
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:543
Scope: file
Source code excerpt:
ENGINE_API void SetDeprecatedInputPitchScale(float NewValue);
/** A getter for the deprecated InputRollScale property. This should only be used if UInputSettings::bEnableLegacyInputScales is turned on. */
UE_DEPRECATED(5.0, "SetDeprecatedInputRollScale is deprecated, please use the Enhanced Input plugin Scalar Modifier instead.)")
UFUNCTION(BlueprintCallable, Category = PlayerController)
ENGINE_API void SetDeprecatedInputRollScale(float NewValue);
/** Whether the mouse cursor should be displayed. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=MouseInterface)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:1570
Scope: file
Source code excerpt:
/**
* Add Roll input. This value is multiplied by InputRollScale.
* @param Val Amount to add to Roll. This value is multiplied by InputRollScale.
*/
UFUNCTION(BlueprintCallable, Category="Game|Player")
ENGINE_API virtual void AddRollInput(float Val);
/** Returns true if the given key/button is pressed on the input of the controller (if present) */
UFUNCTION(BlueprintCallable, Category="Game|Player")
ENGINE_API bool IsInputKeyDown(FKey Key) const;
/** Returns true if the given key/button was up last frame and down this frame. */