oculus quest development

How to get started with Oculus Quest development in Unity

As soon as my Oculus Quest arrived, I immediately started playing with it and have fun with Beat Saber, Robo Recall, Creed and all the other titles. But then, as a developer, I felt the urge to understand how to develop my applications in Unity for the Oculus Quest. And I guess that if you are a developer like me, you had my some thought. That’s why I decided to create this little tutorial: to help all the Unity developers that want to get started in developing for the latest Oculus standalone device in understanding what are the first steps to follow.

If you have already developed for other Oculus devices like Go or Rift, the good news is that the process is mostly the same. The reason is that Oculus uses the same plugin to handle all its devices, and that’s a good thing for developing cross-platform titles. And there’s even more: the structure of the plugin is remaining constant over time… I can say that there are some things that have not even changed from the Oculus DK2 times! So, even if you are not developing for Oculus devices since a lot, you will need very little time to understand the basics of Quest development.

development on oculus quest vr
Development on Oculus Quest unleashes your creative VR superpowers! (Image by Oculus)
Video Tutorial: How to get started with Oculus Quest development in Unity

I prepared for you a tutorial that covers the basics on how to get started, that is:

  • How you can download Unity
  • How to unlock developer mode on the Quest
  • Where you can find the Oculus Quest plugin for Unity
  • What is the structure of Oculus plugin
  • How to create your first simple scene for VR
  • How to build your Unity project and deploy it on the Quest
  • How to find your application inside Oculus Quest UI

UPDATE: I actually forgot to include in the video the part where you install the Android dev tools, that you can find at the point 2 of the textual tutorial here below.

And for the first time, I decided to make it in a video version, since I know that most people like watching video-tutorials! Forgive me if the video is a bit rough, but it is my first one… and then I made it yesterday evening when I was really tired. I hope you’ll also like my Italian accent πŸ˜‰

Textual Tutorial: How to get started with Oculus Quest development in Unity

If you, like me, like more textual guides, because you can skim them faster, let me provide you also a textual version of the main points highlighted in the video. In the video, I provide you more details and I go more step-by-step, but using this textual guide, you should get the job done the same πŸ™‚

1. Unlock developer mode on your Quest

The first thing to do is unlocking the developer mode on your Quest. To do this, you should:

  1. Turn on your Quest;
  2. Run the Oculus app on your smartphone;
  3. In the Oculus app, select Settings in the lower right corner;
  4. Tap on the button corresponding to your Oculus Quest to perform the pairing;
  5. In the contextual menu that pops up select “Other settings”
  6. In the new settings window that comes to your screen, select Developer Mode;
  7. Click on the slider to activate the developer mode;
  8. Yay! You are now officially a developer!
How to unlock developer mode on Oculus Quest
First steps to unlock developer mode on Oculus Quest. they have to be performed in the Oculus companion app
2. Install Android Tools

In the first version of this article, I forgot an important part of the environment set-up: installing Android development tools (thanks 이상일 for reminding me this)! If you are not an Android developer, you have to install Android Studio, with the related Android SDK and Android SDK Tools, so that your PC becomes ready for Android development.

I won’t go too much into details about that here, because it would require a separate guide only for that. Anyway, the most important thing to do is installing Android Studio downloading it from its website. After that, you must use its IDE to install the required Android SDK. Open Android Studio and select Tools->Android -> SDK Manager to open the SDK Manager. Inside it, you can install the required SDKs for Android development.

I suggest installing Android 4.4 (SDK 19) and Android 7.1 (SDK 25). Install also the various SDK Tools and Platform Tools. After that, put the directory <Android_sdk_install_dir>\platform-tools inside the PATH environment variable, because this may help you in the future if you want to use ADB (e.g. to record videos). If you have installed Android Studio without specifying custom directories, <Android _sdk_install_dir> may be found in “C:\Users\<username>\appdata\local\android\sdk” in Windows PCs.

If you want some help for all this process, have a read to this tutorial.

UPDATE: As Ivan Berg makes me notice in the comments, you can install Android Tools during Unity installation process, while you select the Android Build Support.

3. Install and run Unity

If you have not installed Unity, yet, get it directly on Unity website. If you are experimenting on your own, select that you want to try the personal edition, that you can use for free forever until you (or your company) make more than 100K every year.

Personally, I’m still using Unity 2018.3.6f1, because it is the one that I’m using for other projects what I’m developing for my consultancy company (contact us if you need an AR/VR solution!), but actually Oculus advises to have one of these 3 versions:

  • 2017.4 LTS
  • 2018.4 LTS
  • 2019.1.2f1

And in general, to have a version above the 2017.4.11f1. If your Unity version is not one of three ones specified above, some problems may arise (I’ve read for instance that there are some known issues with Unity 2018.2). Personally, I have had no problems with the version that I’m using.

When installing Unity make sure that you install the Android Build Support.

Once you have installed Unity, launch it.

Unity Logo
Unity Logo (Copyright: Unity Technologies)
4. Create a new project

At Unity startup, select that you want to create a new project (there is a button in the upper right part of the window) and call it as you wish, for instance “OculusQuestTest”. It must be a 3D project (it should be the default option already).

As the folder, pick the one that you prefer on your drive. Keep in mind that Unity will create in this folder a subfolder with the name of the project that will contain all the elements of the project itself.

When you’re ready, hit “Create Project”.

Unity Quest New Project
The window to create a new project in Unity

At this point, Unity will show you its typical interface, with your blank project opened.

5. Import Oculus Plugin

Oculus has made things easier for developers recently: you can download the Oculus Plugin directly from inside Unity. The steps to do this are:

  1. In the Unity menu select Window -> Asset Store;
  2. In the Asset Store window that will pop up, write “Oculus Integration” in the search box that is in the upper part of the layout;
  3. Click on the first result (a plugin made by Oculus, that is free);
  4. In the corresponding details page, hit the Download (or Update, if you had already downloaded it) button. Play with your cat while the system downloads the plugin;
  5. Once the download has finished, the button will become “Import”. Click on it again;
  6. In the upcoming window, select “Import”. Play again with your cat while Unity imports and compiles all the resources;
  7. If after that you see a dialog window asking you if you want to update the Oculus Plugin Utilities, select “Yes”. Select “Restart” in the next window;
  8. Unity will re-start itself. Time to play with your cat again!

Cool, now you are ready to develop for Oculus devices!

Oculus Quest Unity Integration
Unity Asset Store page of the Oculus Integration
6. Create your first VR scene

We will now create an amazing VR experience with a cube in front of you. I know… it’s your dream app… so, let’s make it!

  1. In the Hierarchy window in Unity’s interface, click on “Main Camera”. Then click “Canc” on your keyboard to remove it from the scene. We are removing the standard camera, to add a VR camera;
  2. In the Project window, navigate to Assets\Oculus\VR\Prefab;
  3. Drag the OVRCameraRig prefab into the Hierarchy window. This will make sure that we will have a VR camera that will represent our player’s head;
  4. In the Hierarchy Window, click on the little Create button and select 3D Object -> Cube. A cube will appear in your scene;
  5. With the cube selected in the Hierarchy Window, look at the Inspector window on the right. In the Transform behaviour, set the Position: Z value to 2 to move the cube in front of the head of the user;
  6. Save the scene using the menu File -> Save

Cool, we have just made our VR cube scene!

How to develop in Unity for Oculus Quest
At this point, you should have a similar situation (click to enlarge in a new tab)
7. Set build settings

Let’s configure the build of your project!

  1. In the menu select File -> Build Settings…;
  2. In the build settings window, in the Scenes In Build upper part, select the “Deleted” entry, if any, and hit Canc on your keyboard to remove it;
  3. Click the Add Open Scenes button to add your just created amazing cube scene to the build of your project;
  4. In the Platform tab, select Android and then hit Switch Platform. This will take a while, so give some food to your cat;
  5. When Unity will have finished, click on the “Player Settings…” button in the lower left corner of the window. This will open the Player Settings in the Inspector of the main Unity window (so on the right);
  6. Change the Company Name and the Product Name as you wish in the upper part of the Player Settings.
  7. Scroll down and unfold the “Other Settings” section;
  8. In the Identification part, change the Package Name so that it is coherent with your organization (e.g. call it com.yourcompanyname.OculusQuestTest);
  9. Always in the Identification part, change the Minimum API Level to 4.4 KitKat;
  10. Scroll down and unfold the “XR Settings” section;
  11. Check that Virtual Reality Supported is checked;
  12. In the Virtual Reality SDKs part, click on the little “+” button and select “Oculus”.

The project is now ready to build!

Oculus Unity settings
Everything has been set up! (click to enlarge in a new tab)
8. Build and run!

We are finally so close to run our game!

  1. Connect your Quest to your PC via an USB cable;
  2. Put the Quest on your head and if the system asks you if you want to enable USB debugging for this PC, select to remember the choice and then select Yes;
  3. Go back to Unity and in the Build Settings window click on the “Build and Run” button in the lower right corner;
  4. Choose a name for your APK and select where you do want to put it (it is not important for the final result);
  5. Wait for the system to build your game and deploy it to your device. Your cat will help you in spending your time;
  6. When the build has finished, put the Quest on and enjoy your cube!
  7. After that, let your cat enjoy it as well.

Congratulations! You have made your first application for the Oculus Quest!

Oculus Quest Cube app
A marvelous cube in VR!

UPDATE: A little group of readers reported that the app created this way crashed on start. In this case, try the solution suggested by Ivan Berg in the comments: select Project Settings -> Player -> Other Settings -> Graphics APIs -> (Remove Vulcan)

9. Future possibilities

To continue learning development, have a look at the sample scenes that are located in Assets\Oculus\VR\Scenes and in Assets\Oculus\SampleFramework\Usage. You will learn a lot from them.

You can also read the official documentation of Oculus Quest development in Unity that you can find at this link.

Or just enjoy this cat vs cucumbers video


This tutorial is over and I hope that it has been useful for you to get started with Oculus Quest development in Unity. If it is the case, please share it with your peers, and let me know in the comments or on my social media channels if you want me to make other Quest dev tutorials (and what you would like to see).

Consider also making a donation to my Patreon to support my creation of free resources for the VR community!

Have fun with Oculus Quest development πŸ˜‰


Disclaimer: this blog contains advertisement and affiliate links to sustain itself. If you click on an affiliate link, I'll be very happy because I'll earn a small commission on your purchase. You can find my boring full disclosure here.

Releated

playstation vr 2

The XR Week Peek (2024.03.26): Sony halts production of PSVR 2, Meta slashes the price of Quest 2, and more!

This has been the week of GDC and of the NVIDIA GTC, so we have a bit more pieces of news than the usual because there have been some interesting things announced there. Oh yes, also IEEE VR had its show. Actually, a lot of things happened for tech people in the US, which is […]

We need camera access to unleash the full potential of Mixed Reality

These days I’m carrying on some experiments with XR and other technologies. I had some wonderful ideas of Mixed Reality applications I would like to prototype, but most of them are impossible to do in this moment because of a decision that almost all VR/MR headset manufacturers have taken: preventing developers from accessing camera data. […]