Setup XR hands

This section describes how to implement XR Hands on our avatars.

Before You Begin:

  • Ensure your Unity project uses the XR Hands Package (this example uses version 1.3.0).

  • Enable hand tracking on your VR device.

Our avatars are already XR Hands compatible. This means there's no need to add any custom transformations for it to work. The only difference is the naming of the bones, making the initial bone setup more difficult than with XR Hands' default method of finding the correct joints. The following steps simplify this process:

1. Create a Custom XRHandSkeleton Driver (RpmHandDriver)

This class doesn't interfere with the default flow of how the hands are set up and controlled by XR Hands. It simply speeds up the initial setup by setting the correct JointTransformReferences. The code for this class is available here.

2. Setup scene

In your XR scene, under XR Origin, add two empty GameObjects (one for the left hand and one for the right hand). For both objects, add RPMHandDriver and XRHandTrackingEvents. Ensure the following:

  • The XRHandTrackingEvents handedness is set to the correct hand.

  • The hand bone is set to the correct bone from the avatar (LeftHand or RightHand).

  • XRHandTrackingEvents is added to the RPMHandDriver.

3. Setup bones

Assign the correct bone references by clicking on the context menu and selecting the "Set Bone Reference" option. This will automatically fill in the correct joints for the hand driver.

Once completed, you should see all the bones listed under the Joint Transform References.

  1. Run the Scene

Play the scene and watch the hands come to life!

Last updated