Controllers / Hand Tracking Switch
The QCHT Interactions Toolkit gives the ability to seamlessly switch between Hand Tracking and Controllers when Controllers are available.
Based on XRIT, the interactions implementation remains the same for both Hand Tracking and Controllers. Only the XR Switch Hand To Controller Manager component is required to enable the system.
Description
Both hands and controllers are independently driven by their own XR Controllers and have their own XR Interactors setup.
The XR Switch Hand To Controller Manager component exposes two rules for switching from Hand Tracking to Controllers.
Both Connected: As soon as both left and right controllers are active, Hand Tracking is stopped and Controllers are enabled. If one of the controller batteries drop off, or if one of the controllers is detected still on a surface, then the Hand Tracking is restarted and becomes active again.
At Least One Connected: As soon as one controller is active, Hand Tracking is stopped and Controllers are enabled.
Just moving the controller doesn't wake it up, a button press is require to activate.
Integration
Add an
XRSwitchHandToControllerManager
component to any object in the scene (on the XR Origin for example), and set the variablesisLeftControllerTracked
andisRightControllerTracked
with the isTracked action of the left and right XRControllers as shown bellow.Add prefabs instances
QualcommHandControllerLeft
,QualcommHandControllerRight
for hands andQualcommControllerLeft
,QualcommControllerRight
for controllers in the scene Hierarchy. They should be parented to the Camera Offset or XR Origin game object in the scene to work correctly.
- Assign those prefabs instances
QualcommHandControllerLeft
andQualcommHandControllerRight
to theXRSwitchHandToControllerManager
Left/Right Hand Controller and Left/Right Controller property as shown below.
In this exemple, the isTracked action of the Oculus Touch Controller interaction profile will be used to switch beetwen hand and controllers.
Make sure Oculus Touch Controller Profile is selected as an interaction profile in the OpenXR settings of your project settings: