InputPitchScale
InputPitchScale
#Overview
name: InputPitchScale
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 InputPitchScale is to control the sensitivity of pitch input for player controllers in Unreal Engine. It is used to scale the pitch input values, affecting how quickly the player’s view or controlled object rotates vertically in response to input.
This setting variable is primarily used by the Engine module, specifically within the game framework components such as PlayerController and Pawn. It is part of the input system and affects how player input is processed for camera or character rotation.
The value of this variable is typically set through the PlayerController class. However, it’s important to note that this variable is considered deprecated as of Unreal Engine 5.0. The engine now recommends using the Enhanced Input plugin’s Scalar Modifier instead.
InputPitchScale interacts closely with other input-related variables, particularly InputYawScale and InputRollScale, which control horizontal rotation and roll respectively. These variables work together to provide a complete 3D rotation control scheme.
Developers must be aware that:
- This variable is deprecated in UE5 and should not be used in new projects.
- It’s only functional if UInputSettings::bEnableLegacyInputScales is set to true.
- Using this variable may lead to inconsistent behavior across different input methods or platforms.
Best practices when dealing with this variable include:
- Migrating to the Enhanced Input plugin for more flexible and powerful input handling.
- If legacy input scales must be used, ensure UInputSettings::bEnableLegacyInputScales is properly set.
- Consider using the getter and setter methods (GetDeprecatedInputPitchScale and SetDeprecatedInputPitchScale) instead of directly accessing the variable, as these methods provide clearer indication of the deprecated status.
- When updating existing projects, replace uses of InputPitchScale with equivalent functionality in the Enhanced Input system to future-proof your code.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseGame.ini:170, section: [/Script/Engine.PlayerController]
- INI Section:
/Script/Engine.PlayerController
- Raw value:
-2.5
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:10, 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:506
Scope: file
Source code excerpt:
/**
* Add input (affecting Pitch) to the Controller's ControlRotation, if it is a local PlayerController.
* This value is multiplied by the PlayerController's InputPitchScale value.
* @param Val Amount to add to Pitch. This value is multiplied by the PlayerController's InputPitchScale value.
* @see PlayerController::InputPitchScale
*/
UFUNCTION(BlueprintCallable, Category="Pawn|Input", meta=(Keywords="up down addpitch"))
ENGINE_API virtual void AddControllerPitchInput(float Val);
/**
* Add input (affecting Yaw) to the Controller's ControlRotation, if it is a local PlayerController.
* This value is multiplied by the PlayerController's InputYawScale value.
* @param Val Amount to add to Yaw. This value is multiplied by the PlayerController's InputYawScale value.
* @see PlayerController::InputYawScale
*/
UFUNCTION(BlueprintCallable, Category="Pawn|Input", meta=(Keywords="left right turn addyaw"))
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:523
Scope: file
Source code excerpt:
ENGINE_API float GetDeprecatedInputYawScale() const;
/** A getter for the deprecated InputPitchScale property. This should only be used if UInputSettings::bEnableLegacyInputScales is turned on. */
UE_DEPRECATED(5.0, "GetDeprecatedInputPitchScale is deprecated, please use the Enhanced Input plugin Scalar Modifier instead.")
UFUNCTION(BlueprintCallable, Category = PlayerController)
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.)")
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:538
Scope: file
Source code excerpt:
ENGINE_API void SetDeprecatedInputYawScale(float NewValue);
/** A getter for the deprecated InputPitchScale property. This should only be used if UInputSettings::bEnableLegacyInputScales is turned on. */
UE_DEPRECATED(5.0, "SetDeprecatedInputPitchScale is deprecated, please use the Enhanced Input plugin Scalar Modifier instead.")
UFUNCTION(BlueprintCallable, Category = PlayerController)
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.)")
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:1556
Scope: file
Source code excerpt:
/**
* Add Pitch (look up) input. This value is multiplied by InputPitchScale.
* @param Val Amount to add to Pitch. This value is multiplied by InputPitchScale.
*/
UFUNCTION(BlueprintCallable, Category="Game|Player", meta=(Keywords="up down"))
ENGINE_API virtual void AddPitchInput(float Val);
/**
* Add Yaw (turn) input. This value is multiplied by InputYawScale.
* @param Val Amount to add to Yaw. This value is multiplied by InputYawScale.
*/
UFUNCTION(BlueprintCallable, Category="Game|Player", meta=(Keywords="left right turn"))