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.
- Install the "OpenXR Plugin" Unity package through the package manager.
- Also in the package manager click
+->Add package from Git URLand paste incom.unity.xr.interaction.toolkit. - Expand
Samplesand import theDefault Input Actions - In the project view, search for
XRI Defaultand click theAddToActionBased*button in the inspector for all the entries. - Go to
Project Settings->XR Plug-in Managementand tick theOpenXRcheckbox. - A warning should appear next to
OpenXR, click it and thenFix all. - Click
Editon the last remaining warning. - Add interaction profiles for the headsets you want to support.
- Click
GameObject->XR->XR Origin (action-based). - Click the
XR Originand add aInput Action Managerto it. - Add
XRI Default Input Actionsto the list ofAction Assets. - Press play and hopefully it should work.