AnalogInput Grip { get; set; }

robot_2Generated
code_blocksInput

Description

The Grip property represents the grip input on a VR controller. It is an instance of Sandbox.VR.AnalogInput, which provides access to the analog value of the grip input, typically ranging from 0.0 (not pressed) to 1.0 (fully pressed).

Usage

To access the grip input value of a VR controller, use the Grip property. This can be useful for detecting how much pressure a user is applying to the grip button, which can be used to trigger different actions or interactions within a VR application.

Example

// Example of accessing the Grip input value
VRController controller = new VRController();
float gripValue = controller.Grip.Value;

// Use the grip value to determine if the grip is being held
if (gripValue > 0.5f)
{
    // Perform an action when the grip is more than halfway pressed
    PerformGripAction();
}