# Basic Scene Setup
AR Session and AR Session Origin
If required, Hand Tracking also supports AR Foundation 4.X's AR Session and AR Session Origin as described here.
# XR Origin
First, create an XR Origin in the scene as explained here (opens new window).
After creating an XR Origin game object, unfold its hierarchy to view the Left Controller and Right Controller.
Each of the two game objects include an XR Controller component which is not mapped to any input actions by default. These two components may be deleted at this point, as they are not used.
Then, add an XR Hand Tracking Manager component on the XR Origin (or the AR Session Origin) game object.
# XR Hand Tracking Manager
It is possible to create an instance of an XR Hand Tracking Manager through code by using the
GetOrCreate static public API on the
XR Hand Tracking Manager class. See the XR Hand Tracking Manager API.
This component is required to manage the Hand Tracking subsystem. It updates Hand Tracking data at runtime and tracks the user's hand referred to the in XR Origin on which this component is attached (It supports both XR Origin and AR Session Origin). At runtime the Hand Tracking Manager will instantiate left and right hand prefabs, enable and disable instances as hands are tracked or untracked by the Open XR Hand Tracking layer.
Add a Hand Tracking Manager to your scene by right-clicking in the scene's Hierarchy and selecting QCHT > Hand Tracking Manager.
# In Editor Simulator
To enable the XR Interaction Toolkit Device Simulator (opens new window) for simulation, enable the simulation subsystem in the Hand Tracking Simulation section of Unity's Project Settings.
Then, enable Use XR Device Simulator in scenes in the XR Interaction Toolkit section of the Project Settings.
This setting will need to be disabled before building the application to the target platform.
To learn how to use the simulator, refer to the XR Interaction Toolkit Device Simulator documentation (opens new window).
Don't forget to disable "Use XR Device Simulator in scenes" before building the project to the target platform.
When playing the scene in editor, you can quickly switch from head to left/right hand by pressing the tab key of your keyboard.