InputYawScale

InputYawScale

#Overview

name: InputYawScale

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 InputYawScale is to control the scaling of yaw (horizontal rotation) input for player controllers in Unreal Engine 5. It is primarily used in the input system to modify the intensity of yaw rotation when players provide input to turn their character or camera left or right.

This setting variable is mainly relied upon by the Engine module, specifically within the GameFramework components. It is used in classes such as UInputSettings, APawn, and APlayerController.

The value of this variable is typically set through the PlayerController class. However, it’s important to note that as of Unreal Engine 5, this variable is considered deprecated. The engine now recommends using the Enhanced Input plugin’s Scalar Modifier instead.

InputYawScale interacts closely with other input scaling variables such as InputPitchScale and InputRollScale. These variables work together to provide a complete 3D rotation input scaling system.

Developers must be aware that this variable is deprecated as of Unreal Engine 5.0. The UInputSettings class now includes a boolean flag ‘bEnableLegacyInputScales’ which must be set to true to enable the use of these legacy input scales.

Best practices when using this variable include:

  1. Avoid using it in new projects, instead opting for the Enhanced Input plugin’s Scalar Modifier.
  2. If it must be used in legacy projects, ensure that ‘bEnableLegacyInputScales’ is set to true in the UInputSettings.
  3. Consider migrating existing projects to use the Enhanced Input plugin for more flexible and powerful input handling.
  4. When accessing or modifying this value, use the getter and setter functions provided in the PlayerController class (GetDeprecatedInputYawScale and SetDeprecatedInputYawScale) rather than accessing the variable directly.
  5. Be aware that continued use of this deprecated feature may lead to compatibility issues in future engine versions.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseGame.ini:169, section: [/Script/Engine.PlayerController]

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:9, section: [/Script/LyraGame.LyraPlayerController]

#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:515

Scope: file

Source code excerpt:

	/**
	 * 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"))
	ENGINE_API virtual void AddControllerYawInput(float Val);

	/**
	 * 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"))

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:518

Scope: file

Source code excerpt:

	float InputRollScale_DEPRECATED = 1.0f;

	/** A getter for the deprecated InputYawScale property. This should only be used if UInputSettings::bEnableLegacyInputScales is turned on. */
	UE_DEPRECATED(5.0, "GetDeprecatedInputYawScale is deprecated, please use the Enhanced Input plugin Scalar Modifier instead.")
	UFUNCTION(BlueprintCallable, Category = PlayerController)
	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.")

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:533

Scope: file

Source code excerpt:

	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.")
	UFUNCTION(BlueprintCallable, Category = PlayerController)
	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.")

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h:1563

Scope: file

Source code excerpt:


	/**
	 * 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"))
	ENGINE_API virtual void AddYawInput(float Val);

	/**
	 * 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")