To get started with Unity and the Oculus Quest glasses quite a few things have to line up. As of July 2022 the way described here worked.
Both the Unity Editor and the Oculus Software are constantly changing. This means, by the time you read this guide, it might be outdated already (it has been written in July 2022). If you are in doubt please also check the official oculus developer guide.
There are many versions of the Unity Editor. To make it easier to manage your projects and the different versions of the editor software you can use a software called the Unity Hub
For this you need to go to the unity3d-website and click on Download Unity Hub
Then you install the software (how this works depends on your operating system).
Unity has a license model where they allow you to use the Game-Engine for projects going up to a certain revenue (e.g. if you earn below 10k€, but make sure to check yourself). In an art school this is typically not an issue. They still want you to create an account for it, so go ahead and create one
The installation is pretty self-explainatory, except for one step where you have to select the modules that are needed for a Oculus-build. So follow along:
Note: If you forgot to install any dependencies you can add them later by right clicking the editor and clicking on Add Module
Note: you can skip this if the Oculus already works for you
The VR glasses might have been used by someone else before. Before you operate them (or before you give them back if you made a lot of changes) it makes sense to factory reset them:
Factory Reset
with the Volume - and Volume + buttons, then commit the selection with PowerYes, erase and factory reset
and pressing Power againNote: you can skip this if the Oculus already works for you
If the glasses already have a account on them or you had them lying around for a while it makes sense to check for updates once in a while. In the glasses go to:
Settings > About/Info > Update
In order to be able to install your own Games onto the Oculus Quest you need to activate Developer Mode (if it has not been activated already).
For this you need to do both of those things:
Settings > System > Developer
in the menu and turn on the USB Connection Dialog optionFirst you need to connect the glasses to your computer
Edit > Project Settings > XR Plug-in Managment
click on the Small Android Icon and activate Oculus (If this looks different for you, you may have to click the Install XR Plug-In Managmentkbd>-Button):
File > Build Settings
(On a Mac this might be Unity > Build Settings
). Click on the Android Tab and then click the Switch Platform button:
\
Please Note: This is also where you select the Scenes that will be exported (see the Scenes in Build-Section on top)If you were to click the Build-button now, the Scenes in Build would get built ("converted") into a Android Package (a file ending with .apk
) which can then be transfered to the Oculus (e.g. using the adb ("Android Debug Bridge") command line program) and run as an interactive application or game. This means this apk contains all the scenes you included in the Build settings.
If you want a more seamless development experience you can connect the Oculus to Unity:
File > Build Settings
then to the Android TabThe first compilation will take a long time (10 mins on my machine), so be prepared for a wait. But no worries the compilations after this initial one will be much faster.
If it does not work: The Build and Run-button runs the adb
-command line tool in the background. If any other program (e.g. the Oculus Developer Portal) uses adb at the same time, Unity might not find your device. Sometimes it also helps to disconnect and reconnect the cable. If your Oculus is not in Developer mode this will also not work (see instructions above).
Additional Note: If you run a Windows machine you might also consider using Oculus Link and a fast USB-C-cable. This allows you to click the play button in the Unity editor and directly see what is going on which is a lot faster. The cable needed for this is however a fast 4K-ready USB-C cable (the included charging cable does not work for this).
There is a ton of info online already. It might make sense to follow some tutorials. Feel also free to read the follow-up articles on this site.