XR Origin
The XR Origin represents the center of worldspace in an XR scene.
The purpose of the XR Origin is to transform objects and trackable features to their final position, orientation, and scale in the Unity scene. It specifies an Origin, a Camera Floor Offset Object, and a Camera.
Setting up the XR Origin
The XROrigin class is a shared dependency between two packages: AR Foundation (com.unity.xr.arfoundation) and XR Interaction Toolkit (com.unity.xr.interaction.toolkit). AR Foundation and XR Interaction Toolkit are independent packages, but can also be used together to build XR applications. Each package provides different XR Origin configuration options based on the types of hardware each package supports.
How to Setup for mobile AR
To create a pre-configured XROrigin for mobile AR:
- Install AR Foundation (com.unity.xr.arfoundation).
- Enable the provider plug-in(s) for your platform targets in the XR Plug-in Management window.
- Right-click anywhere in the Hierarchy window and select XR > XR Origin (Mobile AR).
Right-click in the Hierarchy window | Select XR Origin (Mobile AR) |
---|---|
How to Setup for VR HMD
To create a pre-configured XROrigin for VR with controllers:
- Install XR Interaction Toolkit (com.unity.xr.interaction.toolkit).
- Right-click anywhere in the Hierarchy window and select XR > XR Origin (VR).
Note
Components in the XR Interaction Toolkit (XRI) are Action-based by default, and make use of the InputSystem. See the XRI Samples for example Input Actions you can use to map inputs from your controllers. If your project depends on the Legacy Input System, a legacy Device-based XR Origin is available by right-clicking in the Hierarchy window and selecting XR > Device-based > XR Origin (Device-based). See Action-based vs Device-based behaviors in the XR Interaction Toolkit manual for more information.
How to setup for all-purpose AR
To create a pre-configured XROrigin for AR which supports both HMD and mobile platforms:
- Install AR Foundation (com.unity.xr.arfoundation).
- Enable the provider plug-in(s) for your platform targets in the XR Plug-in Management window.
- Install XR Interaction Toolkit (com.unity.xr.interaction.toolkit).
- Right-click anywhere in the Hierarchy window and select XR > XR Origin (AR).
- For further configuration guidance of the XR Origin GameObject and its components, see the XR Interaction Toolkit manual.