Building for VR in Unity is easier than it has ever been, but the first hour is still full of traps: the wrong plugin, missing interaction profiles, controllers floating at your feet, a black screen on the headset. This Unity VR tutorial walks through a clean setup in Unity 6 with OpenXR and the XR Interaction Toolkit (XRI), for Meta Quest (standalone and over Link) and PC VR. By the end you’ll have a scene where you can walk, turn, teleport and pick things up, built and running on a headset.
Quick answer
Quickest route: create a project from Unity’s VR template. In an existing project, install XR Plug-in Management, enable OpenXR with the Meta Quest feature, install the XR Interaction Toolkit and its Starter Assets, add the XR Origin rig, and put XR Grab Interactable on objects you want to pick up. Test over Link or with the XR Device Simulator before building to the headset.
The Unity VR Stack in 2026
| Layer | Package | What it does |
|---|---|---|
| Plugin management | XR Plug-in Management | Chooses which XR runtime starts on each platform |
| Runtime | OpenXR Plugin | Talks to the headset through the OpenXR standard (Quest, SteamVR, Windows Mixed Reality, Pico and others) |
| Interaction | XR Interaction Toolkit | Ready-made rig, ray and direct interactors, grabbing, teleport, UI interaction |
| Optional | XR Hands, Meta XR SDK, AR Foundation | Hand tracking, Meta-specific features (passthrough, spatial anchors), mixed reality |
Use OpenXR unless you have a specific reason not to. The old “Oculus XR Plugin” still exists, but OpenXR runs on every major headset with one build setup. If you need Meta-only features, Meta’s own SDK sits on top of OpenXR.
Fastest Start: the VR Template
In Unity Hub > New project, choose the VR (or Mixed Reality) template. It comes with OpenXR, XRI, a sample scene with a working rig, teleport areas, grabbable objects and UI already configured. If you’re starting fresh, use it and skip to testing. The manual steps below are for adding VR to an existing project, and they explain what the template set up for you.
Manual Setup in an Existing Project
- Edit > Project Settings > XR Plug-in Management. Click Install XR Plugin Management if prompted.
- On the Windows/Mac/Linux tab (PC), tick OpenXR. On the Android tab (Quest), tick OpenXR too, and tick the Meta Quest feature group.
- Open XR Plug-in Management > OpenXR. Under Enabled Interaction Profiles, add the controllers you support: Oculus Touch Controller Profile and/or Meta Quest Touch Plus Controller Profile for Quest, plus Valve Index or HTC Vive for PC VR if you target those.
- On the Android tab, enable Meta Quest Support under OpenXR Feature Groups.
- Fix anything the Project Validation page (just below OpenXR) flags. It has a Fix All button that handles most of the Android settings.
- Window > Package Manager: install XR Interaction Toolkit. In its Samples tab, import Starter Assets (and XR Device Simulator, which you’ll want later).
The missing interaction profile in step 3 is the single most common reason controllers don’t track, so don’t skip it.
Add the XR Origin and Locomotion
Delete the scene’s Main Camera. From Samples/XR Interaction Toolkit/<version>/Starter Assets/Prefabs, drag in XR Origin (XR Rig). It contains:
- A Camera Offset and Main Camera driven by the headset.
- Left and right controllers with ray, direct (near) and teleport interactors.
- A Locomotion object with continuous move, snap/continuous turn and teleport providers.
- An Input Action Manager that enables the XRI default input actions.
Select the XR Origin and set Tracking Origin Mode to Floor for room-scale games (the player’s real height is used). Device mode puts the camera at the rig’s position plus the Camera Y Offset, which suits seated games.
For teleporting, add a Teleportation Area component to your floor (it needs a collider) or drop Teleportation Anchor objects for fixed spots. Comfort settings like snap turn angle and move speed live on the providers under Locomotion. Offer snap turn by default. Smooth turning makes many players sick.
Make Objects Grabbable
- Create a cube, scale it to about 0.1 m (VR scale is real-world metres, so a default 1 m cube is huge).
- Add an XR Grab Interactable. It adds a Rigidbody automatically.
- Press Play and grab it with either the near (grip) or ray interactor.
Useful settings on XR Grab Interactable:
- Movement Type: Velocity Tracking collides properly with walls; Instantaneous follows the hand exactly but passes through things; Kinematic is in between.
- Attach Transform: an empty child that marks where the hand holds the object (the grip of a sword, the handle of a mug).
- Throw On Detach: lets players throw objects.
To react to grabbing in code, hook the interactable’s events:
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit.Interactables;
using UnityEngine.XR.Interaction.Toolkit;
public class GrabSound : MonoBehaviour
{
[SerializeField] AudioSource source;
void Awake()
{
var grab = GetComponent<XRGrabInteractable>();
grab.selectEntered.AddListener(OnGrab);
grab.activated.AddListener(OnTrigger); // trigger pressed while held
}
void OnGrab(SelectEnterEventArgs args) => source.Play();
void OnTrigger(ActivateEventArgs args) => Debug.Log("Fire!");
}
In XRI 3.x, interactable classes moved into the UnityEngine.XR.Interaction.Toolkit.Interactables namespace. If you’re on XRI 2.x, remove that using line.
Test Without Building: Link and the Simulator
Quest over Link or Air Link (Windows)
Install the Meta Horizon Link PC app, connect the headset by cable or Air Link, and set Meta Horizon Link as the active OpenXR runtime in its settings. Now pressing Play in the Editor runs your scene on the headset, using the PC (Windows) OpenXR settings. It’s the fastest way to iterate. Link isn’t available on macOS.
XR Device Simulator (no headset)
Drag the XR Device Simulator prefab from the XRI samples into the scene. You can then drive the headset and controllers with mouse and keyboard. It’s clumsy for gameplay but fine for checking UI and interaction logic.
Build to Meta Quest
- Enable Developer Mode for your headset in the Meta Horizon mobile app (you need a developer account/organization, which is free).
- Connect the Quest by USB and accept the Allow USB debugging prompt inside the headset.
- File > Build Profiles (Build Settings on older versions): switch the platform to Android (or the Meta Quest build profile if it’s listed).
- Player settings: IL2CPP scripting backend, ARM64 only, minimum API level Android 10 (API 29) or higher, Vulkan graphics API, ASTC texture compression. Project Validation’s Fix All sets most of these.
- Pick your headset in Run Device and click Build And Run.
The app appears in the headset’s library under Unknown Sources (or a similar filter, depending on the system version) if you launch it again later. If the build fails on Gradle, our Android build failed guide covers SDK, JDK and Gradle errors.
VR Performance Basics
VR has to render two eyes at 72–120 FPS with no dropped frames, on a mobile chip in the Quest’s case. A frame drop in VR isn’t just ugly, it makes people feel sick. Budgets that work on Quest:
- Use URP with the mobile/Quest-friendly settings: MSAA 4x, no HDR, no post-processing or only cheap effects, and render scale 1.0.
- Turn on Single Pass Instanced rendering (the OpenXR default on Quest). It draws both eyes in one pass.
- Aim for roughly 100–200 draw calls and under ~500k–1M triangles visible on Quest 3, less on Quest 2.
- Bake lighting and keep real-time lights to the main directional light. Real-time shadows are expensive.
- Avoid big transparent surfaces and full-screen effects. Overdraw is what kills mobile GPUs.
Measure with the Unity Profiler connected to the device, not in the Editor. Our frame time budget calculator shows how little time 90 Hz leaves you per frame (about 11 ms).
💻 PC VR needs a real GPU
Testing over Link or SteamVR renders your scene twice at high frame rates on your own machine. If your laptop can’t keep up, our free quiz matches you with one that can, for the kind of game you’re making.
Troubleshooting
Controllers don’t move or don’t appear
Add the right controller profile under OpenXR > Enabled Interaction Profiles for that platform tab, and make sure an Input Action Manager in the scene enables the XRI Default Input Actions asset. Without it the actions are never enabled.
Nothing happens on Play (the Game view shows a normal camera)
OpenXR isn’t ticked on the PC tab, Initialize XR on Startup is off, or no OpenXR runtime is active on the PC. Set Meta Horizon Link or SteamVR as the active OpenXR runtime.
The player is on the floor or floating in the air
Check Tracking Origin Mode on the XR Origin (Floor for standing games), and make sure the rig’s root sits on the ground, not at camera height.
Black screen or the app closes immediately on Quest
Usually a missing setting: ARM64 not selected, OpenXR not enabled on the Android tab, or the Meta Quest feature group disabled. Run Project Validation and check adb logcat -s Unity for the real error.
The headset isn’t listed in Run Device
Developer Mode is off, USB debugging wasn’t accepted in the headset, or the cable is charge-only. Run adb devices. The headset should show as device, not unauthorized.
Grabbed objects jitter or lag behind the hand
Use Velocity Tracking with Rigidbody interpolation on, or Instantaneous if collision isn’t needed. See our Rigidbody jitter guide for the underlying cause.
Gear note: this tutorial targets Meta Quest. The Meta Quest 3S was the lowest-priced Quest headset when we wrote this, and a long USB-C link cable makes build-and-test loops much faster than wireless transfers. (Amazon link; we may earn a commission.)
FAQ
How do I make a VR game in Unity?
Create a project from the VR template (or install XR Plug-in Management, OpenXR and the XR Interaction Toolkit), add the XR Origin rig, make objects grabbable with XR Grab Interactable, then test over Link or build to the headset.
Should I use OpenXR or the Oculus/Meta plugin?
OpenXR. It supports Quest, SteamVR, Pico and Windows headsets from one setup. Add Meta’s SDK on top only if you need Meta-only features.
Do I need a VR headset to develop?
Not to start. The XR Device Simulator lets you test with mouse and keyboard. You need a headset to judge comfort, scale and performance.
Can I develop Quest games on a Mac?
Yes, you can build and install to the headset over USB, but Link (pressing Play to run in the headset) is Windows only.
Which render pipeline should I use for VR?
URP. It’s the best-supported pipeline for standalone headsets and the default in the VR template.
What frame rate does Quest need?
At least 72 FPS, steady. 90 Hz is common and 120 Hz is possible. Any drop is noticeable and uncomfortable.
Reader questions
Asked by readers of this article and answered by AI. Behavior can differ between Unity versions, so test in yours.




Leave a Reply