Oculus Quest Development in Unity

Marco Gillies
Virtual Reality MOOC
9 min readJul 2, 2019

--

I recently received my new Oculus Quest, the new all in one headset from Oculus. The Quest is a bit of a breakthrough. It is stand alone in the sense that you don’t need to plug it into a (very high end) PC, but unlike previous mobile VR, it supports 6 Degrees of Freedom Tracking (head position as well as rotation) and two tracked hand controllers. That makes it pretty much equivalent to the Oculus Rift in terms of functionality (though it is running on what is basically a mobile phone CPU and GPU so the graphics power is much lower).

First Impressions

The Quest is a really nice piece of kit. Though I am aware that some of the high end graphics experiences are missing, it doesn’t feel that different from the Oculus Rift. The Oculus Home looks almost as nice (though it relies a lot on baked lighting which is relatively cheap).

The tracking works well. It uses inside out tracking, which means that it tracks where it is in the room using computer vision on cameras on the headset itself.

The headset also tracks the hand controllers using the headset cameras. They are a different shape from the Rift’s touch controllers, probably so they can be tracked more effectively. Initially they didn’t feel quite as nice, but that might be because I am so used to the original touch controllers. The tracking works well, apart from the issue with inside out tracking that I’ve mentioned before: it won’t track your hands when they are out of view of the headset. That isn’t a problem for single user experiences, because you can’t see your hands when they are out of range, but could be an issue with social experiences, where you would be able to see other people’s hands doing strange things.

One of my favourite parts was the initial set up. With the Rift you have to set up the tracking area (the area where you can safely use the headset) before you start. The Quest uses its cameras to show you the real world from inside VR and let’s draw out the space that is free of obstacles and safe to walk. If you walk out of this safe area it shows you the real world again so you can see any obstacles that you might walk into. This is not only a lot safer, it is an unexpected example of augmented reality. Even though the camera image is black and white and not very high resolution, seeing graphics on the real world felt very powerful, maybe because it doesn’t have the limited field of view of the Magic Leap. I hope that they develop this mixed reality possibility in future, I’ve thought for a long time that just using cameras and standard HMD screens could be as good an option for AR as the fancy waveguide technology of the Leap, after all, cameras and screens are very mature technologies.

Developing for the Quest

As my previous article on developing for the Oculus GO is (unsurprisingly) my most popular ever post, I thought I would do the same for the Quest. This is actually going to be a bit of a cheat, since the Quest and GO are essentially the same architecture, the set up is pretty much the same and so I can copy my original instructions. I did consider just linking to the original, but, to be honest, now the Quest is here, I think it will be way more popular than to GO so I think it will just be a pain to look up an old article for an old platform when using the Quest, so here is my updated Quest version.

I certainly found that setting up development wasn’t an easy experience first time, and involved a lot of installing and re-installing. I would recommend that you make sure you have the lastest version of Unity and Android installed and be careful about the Android SDK version (see below).

GearVR/Oculus GO Compatible

Probably the most important information you need to know is that the Oculus Quest uses the same basic archicture as the GO, which is binary compatible with the GearVR.

I had guessed that this means that developing for the GO and Quest is the same as developing for the GearVR, but I couldn’t find that written clearly anywhere, so here I will say it:

Oculus Quest development is (almost completely) the same as GearVR, so you can just follow instructions for the GearVR.

That could almost be the end of this post, because in many ways it is all you need to know, but I thought I would run through the steps. But if you just want to get on with it, this is the full set of instructions from Oculus:

Unity

I’m assuming that most people reading this post will be familiar with Unity, so I’m not going to give detailed instructions, though I would recommend getting the latest version. If you haven’t got unity, just go to their site and follow the instructions:

Android

The fact that Oculus Quest is compatible with GearVR must mean that the Quest runs the Android operating system, and indeed it does. The Quest is just an android device, like any phone.

That means that you have to set the android SDK (software developers kit). I have to be honest, I taught a class on android development for several years, and always found it a bit of a pain, particularly for beginners. The good thing is that all you need to do is install Android and then Unity will handle everything else. The bad news is that installing Android can be a bit fiddly.

You don’t need a full Android environment, just the SDK, but installing Android Studio (the Integrated Development Environment for Android) is the easiest way of doing it. You can find the instructions here:

Once you install android studio, you only need to run it once, to set up the SDK.

When you first open it, you will see this splash screen. Choose configure at the bottom left to set up the SDK:

That will bring up this screen, which allows you to install the SDK:

The first thing that I would do is change the default location (at the top of the screen), to somewhere that you can easily find (on a Mac it defaults to a hidden location, which will make things harder later).

You then need to install the different versions of the SDK that you need (main part of the screen). At the time of writing the Oculus Quest uses Androind 8.1, which is SDK version 27 (this is different from the GO). Then hit OK, it will take a very long time to install, but it will get there eventually. I initially had the wrong version of Android installed which caused an error “merging manifests”. I fixed it up updating unity and installing the correct version of the SDK.

Developer Mode

To be able to run the unity projects you develop on your Android device, you need to enable developer mode. It is pretty easy to find instructions to do that for a phone, but how do you do that on the Oculus Quest, given that the settings menu is pretty minimal?

You actually have to use the phone app that you installed to set up the go. You just select “Settings”. Click on the name of your Quest, and then choose “More Settings”:

You will get to this settings page, where you need to choose Developer Mode:

… which will lead you to this page with a single check box that you need to enable:

Once you have set up Developer mode you need a USB cable to plug your GO into your computer, at which point you will be ready to run your unity projects on the device.

Building for Android

The last stage of the process is to set up your unity project as an Android build. I’ll assume that you already have a unity project suitable for VR.

To get it running on your Quest, go to File menu->Build Settings. This is the settings menu which controls which platforms your project will be built for. On the bottom left you will see a list of possible platforms, select “Android”.

If you haven’t set Android development up yet you will just see this screen:

click on “Open Download Page” to install Android, it will install the Android modules for Unity.

Once you have done that you will see this page:

You should choose the settings listed in this page (at the time of writing they are the same as those in the picture:

You should then close that window enable VR, by going to Edit->Project Settings->Player Settings. The above page is actually a little out of date so the settings page is a bit different from what it lists. You should select the “Android” tab and then go to XR settings.

You should then select “Virtual Reality Supported” and click the little + under Virtual Reality SDKs to select the “Oculus” SDK.

Running your project on the Quest

You should now be ready to run your project on the Quest.

Plug your Quest into your computer using a USB cable. Return to the File->Build Settings menu and click the “Build and Run” button at the bottom right.

It will ask you for a location to save your build (these are all the files needed to run the app on your device) and it will start “building” your project (turning it into a form that can run on the device).

This will take a long time the first time you do it, a very long time (at least in my case). It was several hours and I was convinced several times that it had stopped working, but eventually the build will have completed.

Once the build completes your project should start running on the device. But actually it won’t because the first build will have taken so long that your Quest will have fallen asleep and your connection will have got lost.

Turn everything on again, unplug the go and plug it in again and then hit build and run. This time (and future times) it will build a lot more quickly because most of the hard work has already been done. Once done it should really run on your device and you will actually be able to see your project on your Quest!

And now you can develop…

If you are anything like me the initial set up can be pretty painful, but once it is up and running, things should go more smoothly. After the first build and run you can just carry on working on your project and “build and run” without many problems.

This is part of a blog I have started to support learners on our Virtual Reality MOOC, if you want to learn more about VR, that is a good place to start. If you want to go into more depth, you might be interested in our Masters in Virtual and Augmented Reality at Goldsmiths’ University of London.

--

--

Marco Gillies
Virtual Reality MOOC

Virtual Reality and AI researcher and educator at Goldsmiths, University of London and co-developer of the VR and ML for ALL MOOCs on Coursera.