Unity - Oculus Quest 2 Development Setup

We are going to setup the environment and run a Demo application for the Oculus Quest 2 with Unity.


# First Step

You need to pair to your smartphone and enable Developer Mode in the Oculus app for the smartphone. Once you have done this you can continue in your computer by installing Unity.


# Unity installation

First install Unity Hub and download Unity (a LTS version if you want)

With the installation complete create a new Unity 3D project.

Now we have an empty 3D project:
If you didn't install the needed External Tools as the JDK and SDK, you need to install them from the Unity Hub, just Add Modules to the Unity install, add the Android SDK & NDK Tools, and if you don't have it either, install the Open JDK.
Now if you go to the Build Settings, switch to Android and, with your Oculus Quest connected via USB to your computer, make sure that you can see the device in Run Device.
The name of the device should be something like you see here:

# Oculus Tools 

We need to download the tools from the Unity Asset Store, they are free. Go to the Asset Store and add to Unity the Oculus Integration

In the Unity Package Manager, add the Oculus Integration by downloading and Import everything to your project.


# Unity Setup

There are some changes that we need to do in the Unity settings to get the games and the demos to work properly in the Oculus, such as use OpenGLES3 and the installation of the XR Plug-in.

- Using OpenGLES3

In order to Build and Run for the Oculus Quest 2 we need to change the Graphic API, we need to put the OpenGLES3 before Vulkan in the Project Settings/Player/Other Settings:

- Install XR Plug-in

Make sure that you have XR Plug-in installed for the Oculus. In the project Settings go to XR Plug-in Manager and install it. Then in the Android tab, check the Oculus:

# Testing the Demo Files

You can find some Demos in the files that we imported. Look under the Assets/Oculus/SampleFramework/Usage, there you can find the Demo files such as DistanceGrab:

- Run the demo

Now you can add the scene to the Scenes in Build in the Build Settings and click Build and Run, and make sure to allow your computer to write on the Oculus. Put the glasses on and accept the dialogs. Then the compilation should be starting and when it finishes you can see the demo in your Oculus.
 


And that's it! We have a running game created and compiled with Unity in the Oculus Quest 2.

Blender - Procedural Sand Shader - with Download

Quick sand material / shader to add to your project, with a NodeGroup to make it easy to change the parameters. Download at the bottom of the post.