johan helsing.studio

Unity VR Quick Start Guide

This is a brief and opinionated step-by-step guide for how to get VR working in a new Unity project.

We're going with the Unity XR Plugin API, because it lets us support multiple VR headset vendors without rewriting any code.

  1. Install the "OpenXR Plugin" Unity package through the package manager.
  2. Also in the package manager click + -> Add package from Git URL and paste in com.unity.xr.interaction.toolkit.
  3. Expand Samples and import the Default Input Actions
  4. In the project view, search for XRI Default and click the AddToActionBased* button in the inspector for all the entries.
  5. Go to Project Settings -> XR Plug-in Management and tick the OpenXR checkbox.
  6. A warning should appear next to OpenXR, click it and then Fix all.
  7. Click Edit on the last remaining warning.
  8. Add interaction profiles for the headsets you want to support.
  9. Click GameObject -> XR -> XR Origin (action-based).
  10. Click the XR Origin and add a Input Action Manager to it.
  11. Add XRI Default Input Actions to the list of Action Assets.
  12. Press play and hopefully it should work.