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.
-
Install Oculus app and pair the quest 2 https://play.google.com/store/apps/details?id=com.oculus.twilight
-
Enabled developer mode on the Oculus quest app
- Install Unity, I'm using
2021.2.7f1
. Ensure to include android build support.
-
Create a new 3D project in Unity.
-
Enable device for debugging and development
Follow this guide: https://developer.oculus.com/documentation/unity/unity-enable-device/
- Install Oculus integration package from Unity Asset Store. Search for Oculus Integration - install the free package
https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022
- Import Oculus Integration using package manager
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.
- Configure build settings for the Unity project
- Configure player settings App name and version
App identification and location
- Install Oculus XR Plugin
This will install the plugin from package manager.
- Select target device
- Configure Rendering Settings for Oculus Quest
- Configure quality settings
- Create an android manifest
-
Delete the main camera in the scene
-
Drag OVRCameraRig Prefab from Assets > Oculus > VR > Prefabs Configure as per https://developer.oculus.com/documentation/unity/unity-add-camera-rig/
-
Drag controller prefabs onto the OVRCameraRig
Ensure to set the Controller property in the inspector to match the anchor
- Create a plane so you don't fall into oblivion.
- Build and Run the Game
Make sure Oculus device is switched on.
Once the app is deployed to Oculus you should ne able to see the controllers and animations.