Description
The LeftTrigger
field is a member of the InputAnalog
enumeration in the Sandbox API. It represents the left trigger input on a game controller. This analog input can be used to detect the pressure applied to the left trigger, with values ranging from -1 to 1, where 0 is the default state (no pressure applied).
Usage
To use the LeftTrigger
field, you can access it statically through the InputAnalog
enumeration. This field is typically used in conjunction with input handling methods to determine the current state of the left trigger on a game controller.
Example
// Example of accessing the LeftTrigger input
float leftTriggerValue = Input.GetAnalogValue(InputAnalog.LeftTrigger);
// Use the value to control game logic
if (leftTriggerValue > 0.5f)
{
// Perform an action when the left trigger is pressed more than halfway
}