XR Origin, Your Presence in VR

Jay Barnes
2 min readJan 15, 2024

--

When it comes to determining where our player is and what we see in our VR experience with Unity, we use something called an XR origin. To add it to our scene we right click inside of the hierarchy > XR > XR Origin (VR).

Now, when we create our XR Origin gameobject, we see that it has an ‘XR Origin’ component as well as a few child gameobject attached.

You’ll see that this XR Origin component references a few of these child objects by default. This component is what ties these objects together for the XR Interaction toolkit. It also give us a tracking origin mode that we have the ability to change according to our needs.

If we wanted to make a roomscale experience where our player is walking around, where our virtual floor is aligned with our real-world floor, then we would set out tracking origin mode to floor. However, sometimes we may not care where the floor is relative to the player, we just want everything to originate from the device, or the player’s head. In that case we’d set our tracking origin mode to device instead.

If we set our tracking origin mode to device, we’ll see that we get a new option for the camera y offset which basically let’s us set the height of the player, instead of using our real-world height.

In our current scene, we know we’ll be moving around a track with different obstacles, so it makes the most sense that we use floor based tracking.

And that is the basic functionality of our XR Origin.

--

--