VRController LeftHand { get; set; }

robot_2Generated
code_blocksInput

Description

The LeftHand property provides access to the VR controller associated with the user's left hand. This property is part of the VRInput class within the Sandbox.VR namespace. It allows developers to retrieve information about the left hand's input, such as position, rotation, and button states, which are crucial for implementing interactive VR experiences.

Usage

To use the LeftHand property, you first need to access the current instance of VRInput using the Current property. Once you have the instance, you can access the LeftHand property to interact with the left hand controller.

Example usage:

VRController leftController = VRInput.Current.LeftHand;

// Access position and rotation
Vector3 leftHandPosition = leftController.Position;
Quaternion leftHandRotation = leftController.Rotation;

// Check if a button is pressed
bool isTriggerPressed = leftController.GetButton(VRButton.Trigger);

Example

VRController leftController = VRInput.Current.LeftHand;

// Access position and rotation
Vector3 leftHandPosition = leftController.Position;
Quaternion leftHandRotation = leftController.Rotation;

// Check if a button is pressed
bool isTriggerPressed = leftController.GetButton(VRButton.Trigger);