XR Interaction Toolkit Examples - Version 2.3.2
Introduction
This project provides examples that use Unity's XR Interaction Toolkit (XRI) to demonstrate its functionality with example assets and behaviors. The intention of this project is to provide a means for getting started with the features in the XR Interaction Toolkit package.
Note: If you are looking for the original XRI Examples project, that has been archived into two separate branches Classic 1.0 and Classic 2.2. Both of these branches still have both the
AR
andVR
projects available.
Getting started
Requirements
The current version of the XRI Examples is compatible with the following versions of the Unity Editor:
- 2020.3 and later
Downloading the project
- Clone or download this repository to a workspace on your drive
- Click the โค Code button on this page to get the URL to clone with Git or click Download ZIP to get a copy of this repository that you can extract
- Open a project in Unity
- Download, install, and run Unity Hub
- In the Installs tab, select Locate or Add to find or install Unity 2020.3 LTS or later. Include the Windows Build Support (IL2CPP) module if building for PC, and the Android Build Support if building for Android (for example, Meta Quest).
- In the Projects tab, click Add
- Browse to folder where you downloaded a copy of this repository and click Select Folder
- Verify the project has been added as XR-Interaction-Toolkit-Examples, and click on it to open the project
General setup
The main example scene is located at Assets/XRI_Examples/Scenes/XRI_Examples_Main
. This example scene is laid out as a ring with different stations along it. The first examples you will encounter are the simplest use-cases of XRI features. Behind each example is a doorway leading to advanced uses of each feature.
Use the simple examples when you need objects you can copy-and-paste, while leveraging the advanced examples when needing to achieve complex outcomes.
The XR Origin is located within the Complete Set Up prefab. This prefab contains everything needed for a fully functional user interaction with XRI. This includes the components needed for general input, interaction, and UI interaction.
Scripts, assets, and prefabs related to each feature or use case are located in the associated folder in Assets/XRI_Examples
.
The following stations are available in the XRI Examples:
- Station 1: Locomotion Setup - Overview of the built-in locomotion options and how to configure them.
- Station 2: Grab Interactables - Basic object manipulation.
- Station 3: Activate Interactables - Manipulation of objects that can be triggered by the user.
- Station 4: Socket Interactors - Manipulation of objects that can snap to specific positions.
- Station 5: Gaze Interactions - Leverage the eye-tracked or head-based gaze interactor to add assistive interaction to your projects.
- Station 6: 2D UI - Creation and interaction with world space 2D UI.
- Station 7: 3D UI - Creation and interaction with 3D constrained controls.
- Station 8: Physics Interactables - Best practices for combining physics and XR input.
For a list of new features and deprecations, see XRI Examples Changelog.
For an overview of how the Input System is used in this example, see Input.
Sharing feedback
The XR Interaction Toolkit and Input forum is the best place to open discussions and ask questions. Please use the public roadmap to submit feature requests. If you encounter a bug, please use the Unity Bug Reporter in the Unity Editor, accessible via Help > Report a Bug. Include โXR Interaction Toolkitโ in the title to help our team triage things appropriately!
Contributions and pull requests
We are not accepting pull requests at this time.