Getting Started with XR Toolkit in Unity (Part 3) — XR Rig
The last two parts of this tutorial was about setting up our project for the XR Toolkit. Now that setup is complete, we can create our player character; the XR Rig.
Creating the XR Rig
In the Hierarchy window, you can find the XR Rig by right-clicking and choosing XR → XR Rig (Action Based).
Once this is selected, Unity will bring in an XR Rig gameobject and an XR Interaction Manager gameobject.
Note: If your XR Rig did not include a main camera (like mine above), then delete the two XR Game Objects and add the XR Rig again.
Now we need to add the Input Action Manager script to a game object in our scene. The most convenient place to put it would be the XR Interaction Manager gameobject. Just click on the XR Interaction Manager in the Hierarchy and in the Inspector window, click Add Component and search for “Input Action Manager” and click it to add it.
Once the Input Action Manager script is added, open the Action Assets list and click on the + icon. For “Element 0,” add the “XRI Default Input Actions (Input Action Asset).”
Fixing the Right Controller
Finally, there is one more thing we need to fix. If you click on the “RightHand Controller” game object, inside the XR Rig, all the References maybe set up for the “LeftHand.”
If this is case, we need to manual change all of this so that they are now the “RightHand.”
That’s it for this post! In the next post, we’ll set up to locomotion for our Rig.