Description
The AnalogLook
property provides the analog look value from the default input device, such as a game controller. This value is automatically scaled by the user's sensitivity preferences, eliminating the need for additional scaling in your code. It is a static property of the Input
class and returns an Angles
object representing the look direction.
Usage
Use the AnalogLook
property to retrieve the current look direction from the player's input device. This is particularly useful for implementing camera controls or character orientation in a game. Since the value is already scaled by the user's sensitivity settings, you can directly use it to adjust the view or orientation without further modification.
Example
// Example of using the AnalogLook property to adjust a camera's rotation
public void UpdateCameraRotation()
{
// Get the current analog look angles
Angles lookAngles = Input.AnalogLook;
// Apply the look angles to the camera's rotation
Camera.Rotation = Rotation.From(lookAngles);
}