XRI and XRHands Integration¶
XR Interaction Toolkit (XRI), created by Unity and enhanced by Ultraleap, is an ideal starting point for XR projects. Designed for dual hand and controller usage (via Unity's XRHands feature), we strongly recommend leveraging XRI with OpenXR for a seamless experience.
This page will teach you how to get set up with XRHands using Ultraleap tracking and also get interactions working using XRI. If you haven't already, check out Unity's documentation here.
What is XR Hands?¶
Unity provides an XRHands API for getting started with XR Hands and how to get Hand Tracking data from various sources.
This package includes a subsystem that provides hand data via OpenXR directly. Continue reading to see how to implement this.
Ultraleap provides a custom subsystem for users that can not, or do not wish to use OpenXR for Hand tracking. Continue reading to see how to implement this.
The best way to import packages mentioned in this guide is through the unity package manager which can be found in “window/package manager” in the menu bar. The Ultraleap package information can be found here: Ultraleap OpenUPM package.
What is XRI?¶
Unity provides a set of interaction systems under the XR Interaction Toolkit (XRI).
XRI provides XR-focussed interactions. It allows you to make one application which works on many platforms, devices and with various input sources (hand tracking, controllers, keyboards, joysticks etc).
Some available Interactors are:
Direct - For triggering events or grabbing objects
Ray - For indirect input, far field UI controls, teleporting, and summoning
Poke - For direct UI (3D and 2D) and triggering events
We recommend exploring the capabilities of the XRI package to determine what is most useful for your project. Unity’s documentation and guides are a great place to get started.
XRI is usually controlled by the Input System. The hands-focussed examples Unity provide come with some specific Input Actions which are driven by XRHands.
To get started with XRI when using Ultraleap Hand Tracking, continue reading.
Setting up your project¶
Install XR Hands, XRI and XR Plugin Management from the Unity Registry in the Package Manager.
We recommend that you use OpenXR with XRI and XR Hands where possible. However, Ultraleap offers a subsystem to use XR Hands directly with Ultraleap hand tracking when OpenXR hand tracking is not available.
Please Select your chosen route from the tabs below:
Using Leap directly, you will need to enable the Leap XRHands Subsystem from Ultraleap Settings.
To use Unity’s XRI Sample content, you will need to enable “Update Meta Aim Input System”.
You can use XRI without this but you will need to reference your own Input actions in the Input System.
And you are ready to build your XRI project! if you want to test out XRI with your hands, we recommend installing the XR Interaction Toolkit samples from the package manager then playing the Hand Interaction Demo.
In order to use the Hands Interaction Demo Sample, you will also need to install the Unity Starter Assets Sample
Assets > Samples > XR Interaction Toolkit > 2.4.1 > Hands Interaction Demo > Runtime > HandsDemoScene.unity
Enable OpenXR in the XR Plug-in Management section in Project settings.
Then enable the hand tracking subsystem within the OpenXR section of XR Plug-in Management.
You should now be able to see your hands if you play one of Unity’s hand demo scenes but you may not be able to interact with XRI.
To use Unity’s XRI Sample content, you will need to go to the Ultraleap settings and enable “Update Meta Aim Input System”.
And you are ready to build your XRI project! if you want to test out XRI with your hands, we recommend installing the XR Interaction Toolkit samples from the package manager then playing the Hand Interaction Demo.
In order to use the Hands Interaction Demo Sample, you will also need to install the Unity Starter Assets Sample
Assets > Samples > XR Interaction Toolkit > 2.4.1 > Hands Interaction Demo > Runtime > HandsDemoScene.unity