Description
The RightHand
property provides access to the VR controller associated with the user's right hand. This property is part of the VRInput
class within the Sandbox.VR
namespace. It allows developers to retrieve information about the right hand's input, such as position, rotation, and button states, which are essential for creating interactive VR experiences.
Usage
To use the RightHand
property, you first need to access the current instance of VRInput
using the Current
property. Once you have the instance, you can access the RightHand
property to interact with the right hand controller.
Example
// Access the current VRInput instance
var vrInput = VRInput.Current;
// Retrieve the right hand controller
VRController rightHandController = vrInput.RightHand;
// Example: Get the position of the right hand controller
Vector3 rightHandPosition = rightHandController.Position;
// Example: Check if the primary button on the right hand controller is pressed
bool isPrimaryButtonPressed = rightHandController.IsButtonPressed(VRButton.Primary);