With the arrival of the Oculus Quest 2, we know a lot of new people will be inspired to create their very first VR experiences. That is why we have put together this step-by-step guide to getting started, so pull up a chair and get ready to develop for the Quest platform!
The first thing to acknowledge if you are new to XR development is that you need three things to create a VR application:
- A Game Engine
- An SDK (Software Developer Toolkit)
- A VR Headset (+ compatible USB cord & the Oculus Smartphone App)
In this article, the three of these that we will look at are the most popular choices for VR at the current moment:
The Oculus Quest or Oculus Quest 2 (Oculus Link not needed)
Not coincidentally, these are the tools we work with most commonly in our 12-Week AR VR Developer Bootcamp. Let’s use them now to get you up and running. For this guide, you will not need to know C# or write any code. Also, we will use the Unity Interface and other GUI software to configure everything for your VR scene.
Additionally, do you want the chance to take care of some of these steps and download a free VR game at the same time? Try this SideQuest tutorial, and then come back to this article when you’re ready to develop your own game.
Unity is constantly updating and improving its software by creating new versions. In order to pick the version we need, you need to follow a few steps:
Whether or not you use the free or paid version, you will need to create a license in order to use Unity. You can either follow the instructions in this video linked here, or follow the directions below.
- Click on the gear icon in the top-right-corner next to the profile icon.
- Navigate to ‘License Management’, and then click on the blue “Activate New License” button.
- From the window that pops-up, select the appropriate license you will be using. (Thankfully, the Unity Personal license is free!)
If you get lost in these written steps, there is always the video instructions.
Once Unity Hub is installed, you can download Unity itself. From installs, Select the right version of Unity:
- Use the “Installs” Tab in Unity Hub to find and select the version you want to use:
- Note: To support the XR Interaction Toolkit (i.e., VR functionality) must be versions 2019.4 or later.
- Ideally, choose a version with Long Term Support (LTS).
Under the Installs Tab, add these modules to your version of Unity:
- If this is your first time using Unity, you will want to add “Microsoft Visual Studio 2019”; it’s a very nice Integrated Development Environment (IDE) for coding in C# within Unity (which most Unity devs use).
- You will need to check the box for “Android Build Support” since the Oculus Quest is technically an Android device (The Quest runs on a customized build of Android 7, and the Quest 2 runs on Android 10.)
Create a new Unity Project from Unity Hub.
- Make sure to save your project somewhere you can find it later.
- For “template”, the choice between 3D, 3D with Extras, and the Universal Render Pipeline are a little too detailed to explain in this article. However, we can tell you that while either would work for a starter VR project, the ‘Universal Render Pipeline’ has more optimized graphics (which you will learn to appreciate as you get further into VR development).
- Choose ‘Universal Render Pipeline’.
- Once selected, hit the “Create” button.
Now that your project is both created and open, use Unity’s ‘Package Manager’ to import a couple of VR-related packages into your project:
In the drop-down menu, on the top left, find ‘Window > Package Manager’, and open the ‘Package Manager’.
Once the Package Manager window shows up, you can either scroll through the list or type in the search-bar to look for packages.
- From the Package Manager, Click ‘Advanced’> ‘Show Preview Packages’.
Now, Find and Install these three packages with the Install button in the bottom right corner of the window:
- The ‘XR Interaction Toolkit’ package
- The ‘XR Plugin Management’ package
- The ‘Oculus XR Plugin’
Now, with packages installed, you are ready to start changing the ‘build settings’ of your project!
Step 4. Project Build Settings
First, in the dropdown menu at the top left, navigate to ‘File > Build Settings’.
From Build Settings, you will want to switch your platform from PC to Android because, technically, the Oculus Quest is an Android device. (The Quest runs on a customized build of Android 7, and the Quest 2 runs on Android 10.)
- Do this by selecting ‘Android’ in the list of ‘Platforms’ and clicking on ‘Switch Platform’ in the bottom right of the window
- (Note: Currently, your project is empty, but in the future, this may take a while depending on how many assets in your project you need to reimport; ideally you would do this step before you’ve added anything into your project.)
Next, in the Build5 setting that will show up, Change the “Texture Compression” dropdown to ‘ASTC’.
Now, in the dropdown menu at the top left of Unity, navigate to ‘Edit > Project Settings’ and, in the window that pops-up, select ‘XR Plugin Management’.
Click on the ‘robot icon’ in the-top-right to bring up plugins for standalone devices, and check the box next to ‘Oculus’. It may take a minute to import. This is normal.
Now, you will need to adjust your ‘player settings’. Navigate back to ‘Edit > Project Settings’, and from the list on the left of the window select ‘Player’.
Name your Company and your Product Name. This will make it easier to find your app once it’s on your Quest device.
Then scroll down and find the “Minimum API Level” and set it to at least level 23 (6.0 marshmallow)
Step 5. Creating a Quick Scene
You need something to load onto your Quest device!
Create a new scene by navigating to ‘File > New Scene’.
With the ‘XR Interaction Toolkit’ installed, you should be able to navigate to ‘GameObject > XR > Room-Scale XR Rig’.
Add a floor to stand on in your scene by going to ‘GameObject > 3D Object > Plane’.
Save your Scene: ‘File > Save’
Now that is saved, navigate back to ‘File > Build Settings’, and below the box at the top, click ‘Add Open Scenes’, and un-check the starting ‘Sample Scene’.
Step 6. Android Tools and Sideloading Time
Sideloading is a term used in the developer community that means installing an APK file onto an Android device. (APK stands for Android Package File.) Since the Quest devices are built on Android, sideloading means the same thing here.
In short, you will be sideloading an APK file from Unity onto your Quest device.
But, before we can sideload an APK file from Unity to your Oculus Quest, you need to first install some Android Development tools.
Install any version of the SDK later than 4.4 Kitkat, API Level 23 (Use Level 19 or higher if Level 23 is not available), by checking the box and hitting “Apply” at the bottom right corner of the window.
Check the SDK Tools Tab to make sure you have Android SDK Build-Tools and Android SDK Platform-Tools installed.
6 b. Register with Oculus as a Developer
Now, in order to turn on Developer Mode on your Quest, you will need to register as a developer with Oculus:
Go to the Oculus phone app on your phone (The one you used originally to set up your Quest.)
- Make sure your headset is turned-on and nearby so that your phone can connect to it.
- Once you see that your Oculus device is connected to your phone, follow these directions to enable developer mode
- Video Directions: https://youtu.be/CQ6TcLwSGag?t=260
Log in to your Oculus account.
- Go to: https://dashboard.oculus.com/organizations/create/
- Create an Organization name: This can be anything you want.
- Accept all agreements after reading.
- Now your organization will appear on the left side (CaseyXR in this example)
6 c. Windows Users only: Download ADB Drivers (This step not required for Macs)
If you are on a PC, download these drivers (Mac owners do not need to follow this step):
Extract the files
- Navigate to the ‘androidwinusb.inf’ file> right click>install. Then, click ‘open’. Allow any messages
Step 7. Getting your phone and Quest ready
Now that you have followed the directions for enabling developer mode on your Quest, go get your smartphone and the USB cord you plan on using to connect your Quest to your computer…
Start with your smartphone
Find your headset in the Oculus phone app, and click on it to make sure it is enabled
Select ‘More Settings’, click on ‘Developer Mode’, and enable it.
- You may be asked to create a Developer certificate. Accept.
Now the developer mode is enabled for the Quest through your phone, reboot your Oculus Quest by turning it off and on.
After it has rebooted, Connect your Quest device to your computer using a USB cord. (The charging cord that came with your quest will work as long as your computer has a USB C port.)
- If you don’t have that kind of cord, you can shop for a compatible cord or adapter (USB C to USB or Get an Adapter).
- If your computer does not have a USB C port, check to see if your Android smartphone charging cable will work.
Now that your Quest is plugged into your computer, look inside your VR headset. There might (or might not) be a pop-up that asks you to “allow USB Debugging”. If so, click ok (using the Oculus Quests’ controllers.)
- If you get an “Oculus Link” pop up. Click “Not Now.”
- If it asks you to set up a guardian, go ahead and do so.
- Then, take off your headset.
Go back to Unity and check to make sure your headset is recognized when it is plugged in.
- Navigate back to ‘File > Build Settings’, and see if your device is recognized under ‘Run Device.
- (Note: You may need to hit the refresh button, seen below, after plugging in your headset.)
Now click ‘Build and Run’ at the bottom right of the ‘Build Settings’.
Name your build (and ideally save it in its own Builds folder.)
Be sure to wait for the build to complete before putting on your headset!
Behold, you have created a VR world with Unity! No longer are you confined to the limits of this reality.
If the app doesn’t start automatically when you put on the Quest, go to your ‘apps tab’ in your Quest device and find the section called “Unknown Sources”, where you can find the app by the name you gave it (e.g., MyFirstVRApp”).
If everything worked, you should be able to see your floor and a couple of red lines coming from your Controllers!