Getting started with VR Development with Unity and Oculus Quest 2

December 20, 2021

Defaults

This article is all about how to get started building VR games on the Oculus Quest 2 using Unity.

I followed this guide on the Oculus website: https://developer.oculus.com/documentation/unity/unity-gs-overview/

Go here and set up Standalone headset and unity as defaults.

Defaults

  1. Install Oculus app and pair the quest 2 https://play.google.com/store/apps/details?id=com.oculus.twilight

  2. Enabled developer mode on the Oculus quest app

Settings

Developer-Mode

  1. Install Unity, I'm using 2021.2.7f1. Ensure to include android build support.

UnityVersion

Modules

  1. Create a new 3D project in Unity.

  2. Enable device for debugging and development

Follow this guide: https://developer.oculus.com/documentation/unity/unity-enable-device/

  1. Install Oculus integration package from Unity Asset Store. Search for Oculus Integration - install the free package

SearchIntegrationPackage https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022

  1. Import Oculus Integration using package manager

PackageManager

I got this warning when importing. Clicked Use OpenXR for now, but its says its easy to switcvh to legacy backends if I need to later.

PackageManagerWarning

  1. Configure build settings for the Unity project

BuildSettings

  1. Configure player settings App name and version

PlayerSettings1

App identification and location

PlayerSettings2

  1. Install Oculus XR Plugin

This will install the plugin from package manager.

XRPlugin

  1. Select target device

TargetDevice

  1. Configure Rendering Settings for Oculus Quest

RenderSettings

  1. Configure quality settings

QualitySettings

  1. Create an android manifest

Manifest

  1. Delete the main camera in the scene

  2. Drag OVRCameraRig Prefab from Assets > Oculus > VR > Prefabs Configure as per https://developer.oculus.com/documentation/unity/unity-add-camera-rig/

  3. Drag controller prefabs onto the OVRCameraRig

Ensure to set the Controller property in the inspector to match the anchor

Controllers

  1. Create a plane so you don't fall into oblivion.

Plane

  1. Build and Run the Game

Make sure Oculus device is switched on.

Build and Run

Once the app is deployed to Oculus you should ne able to see the controllers and animations.

Running

Sharing is caring

Stay In Touch

Connect with Me

© 2021, Created by me using Gatsby