Virtual Reality
July 10, 2021
8 Min Read

Start Developing for Meta Quest in Unity with This 10-step Setup

by

Sarah Rowe

In this tutorial, we’ll demonstrate how to setup your Oculus Quest with Unity for development: from putting your device into developer mode, to setting up your Quest controllers.

We’ll be developing our Oculus Quest in OpenVR because of its cross-platform capabilities.

Hot to Enable Developer Mode on your Quest 2

First up, you’ll have to download the Oculus app onto your phone. You’ll be able to manage all Oculus devices through this app.

Oculus VR app interface

Once the app is installed, turn on your Quest. In your Oculus app, select “Settings” in the lower right corner.

Select your Oculus Quest from the list. If it isn’t appearing, try restarting your Quest.

In the menu that appears when you select your Quest, select “Other Settings.” Click the slider to activate Developer Mode.

At this point you’ll be prompted to register for a developer certificate with Oculus. If you already have one, you can move to the next step!

Install Android Tools

You’ll be using Android SDK and related tools in Unity, so we’ll have to make sure you have these plugins installed.

android studio

Download Android Studio from their website. Open Android Studio, go to your top menu to access “File,” then “Settings” to open your SDK Manager.

Download and install:

  • Android 4.4 (SDK19)
  • Android 7.1 (SDK 25)
  • SDK Tools (In the “Android SDK Tools” tab)
  • SDK - Platform Tools

android sdk installation window

Install and run Unity

If you haven’t installed Unity yet, let’s get that process started. It’s free and available on Unity’s website here.

Download unity 3d 2019

When installing Unity, make sure you install the Android Build Support with it.



To develop for Oculus Quest, you’ll want the 2017.4 version of Unity or higher.

Create a New Unity Project

Let’s open up Unity and create a new project. Name it something unique that you’ll remember. Change your Template to “3D”. Lastly choose the folder location where you’d like to save this project.



Download and Import Oculus Plugin

Oculus tries what it can to make building for its devices easy on the developers. The Oculus plugin is compatible for the Quest and all other Oculus devices. Plus it’s free, bonus!



To download and/or import the plugin, go to Unity’s Asset Store along the finder bar at the top of your screen. Once the Asset Store window opens, search for “Oculus Integration.” Download this plugin, or import it into your project if you already have it downloaded.

Your Unity project may ask if you want to update the Oculus Plugin Utilities. Select “Yes” and “Restart”. Sit back and relax while your computer does its thing.



Install OpenVR and XR Legacy Input Packages

Head back up to your finder bar at the top of the screen and mouse over “Window” then click on “Package Manager” and select the tab “All.” This is a long list of available packages to install in your project. The two we’re looking for are “Open VR” and “XR Legacy Input Handlers.” Select them to install, and close the Package Manager.



Note that “XR Legacy Input Handlers” may not be listed if you’re using an older version of Unity. If this is the case, the Input Handlers are automatically installed.

Set Your Project's Build Settings

You’re doing great! We’ve downloaded and installed all the tools you need to develop for Oculus Quest. Now we need to make sure they’re configured to work with your project.

In Unity, go to your top menu, hover over File, and click on “Build Settings…”

The Build Settings window appears. If there are any settings listed in the “Scenes in Build” area, select them and delete them. We want to start from scratch.

Click on the “Add Open Scenes” button and add the scene you currently have open. This may take a minute or two.

In the Platform menu within “Build Settings” click on “Android” and select “Switch Platform.” While doing this, make sure your Texture Compression is set to “ASTC.”



Next, Click on “Player Settings” on the lower left-hand side of the window. This opens another window on the far right off the screen. In “Player Settings,” you’ll want to change:

  • Company Name
  • Product Name



Scroll down and unfold the “Other Settings” section. In the “Identification” section, change Minimum API Level to 4.4 KitKat. Confirm your Package Name is along the lines of “com.company name.product name”



Scroll down and unfold the “XR Settings” section. Confirm that “Virtual Reality Supported” is checked.



Lastly, in the “Virtual Reality SDKs” section, click on the little “+” and select “Oculus.” Then click “Build” on the bottom right-hand side of your Build Settings window. You’re now ready to start building!

Note: Some users get an error at this point. If this is the case for you, go back into “Other Settings” and into the “Graphics API” list. Remove “Vulcan” and your error should be resolved.

Setup Your Quest Controllers

We’re going to set up a couple of spheres to represent your controllers ingame. You can download any asset from Unity’s Asset Store to represent your controllers and hands, but for simplicity in this tutorial we’ll be using spheres.

Head over to your Hierarchy on the left hand side. Right-click to add a GameObject, and let’s add a sphere.

On the right hand side is your Inspector. When selecting your new Sphere, head to the Inspector and set the scale of your sphere to 0.1 in X, Y, and Z fields (this is 0.1 meter).

Right-click in the Inspector to add a Tracked Pose Driver component to the sphere. (This is why we needed the XR Legacy Input Handler package). In this component, set your “device” to Generic XR Controller.

Add another component, this time a Rigid Body Component to your sphere. Enable the “isKinematic” property, and disable “Use Gravity.”

Duplicate this sphere and change your “Pose Source” in the Tracked Pose Driver to “Right Controller”. Double check that the other sphere’s “Pose Source” is set to “Left Controller.”



Next, set the position of your Main Camera and spheres to 0, 0, 0 in the Inspector. Great!

Set Up Your VR Scene

Let’s add a Cube to the scene so we have something to see and interact with while in game.

Right-click in the Hierarchy tab to create a new GameObject and select a Cube.

Set the position of the Cube to 0, 0, 1 so it will appear 1 meter in front of you.

In the Cube’s Inspector tab, add a RigidBody component, and make sure to disable “Use Gravity” so the Cube floats in front of you.



Save your scene by going to your top menu, hovering over File and selecting Save.

Launch Your Project onto Your Meta Quest

We’re very close to being done!

Connect your Oculus Quest to your computer through a USB cable. Put on the Quest and enable USB debugging for this computer.

Back in Unity, head back up to the top menu to File and “Build Settings…” Open the Build Settings window and click on “Build and Run” in the lower right-hand corner. Alternatively you can go to the top of the Unity menu, select Oculus, and access Build and Run from there.

You can then choose a name for your APK (Android Package Kit) and select where to save it. We generally recommend creating a new folder labeled “Builds” for easy organization.



After saving, Unity will have saved your application onto your USB-connected Quest. You can now disconnect the Quest from your computer and launch the project.

To find your project while wearing the Oculus Quest, go to your Libraries on the left-hand menu, select Unknown Sources, and your project should be listed there.

What's Next

Building for the Oculus Quest is an ambitious endeavour, good job! It’s a great device to get started with.

Now that you’re setup for Oculus Quest development, you’re ready to get building more advanced projects. Check out our programming guide for tips, advice, and resources to developing a VR app.

If you’re looking for guidance in Unity development, we can help with that. Through our 10-week course and one-on-one training, we’ll take you from idea to prototype to finished app. Download our syllabus to learn more about what we can teach you!

Technical Steps:

  1. Unlock Developer Mode on Oculus Quest
    1. Download Oculus App onto your phone
    2. Turn on Oculus Quest
    3. Select Oculus App settings
    4. Select your Quest from the list of devices
    5. Select Other Settings
    6. Select Slider to activate Developer Mode
    7. Register for Developer Certificate with Oculus if you haven't done so already
  2. Install Android Tools
    1. Download Android Studio
    2. Open Android Studio and Select File > Settings > Android SDK
    3. Within the Package Manager, download and install:
      1. Android 4.4 (SDK19)
      2. Android 7.1 (SDK25)
      3. SDK Tools (within the SDK Tools tab)
      4. SDK - Platform Tools (within the SDK Tools tab)
  3. Install and run Unity
    1. Download Unity with version 2017.4 or newer
      1. Ensure Android Build Support selected to download as well
  4. Create new Unity project
    1. Go to Unity's Asset Store and search "Oculus Integration"
    2. Download, Import, or Update the plugin, depending if you've accessed it before
    3. If prompted, update Oculus Plugin Utilities and restart Unity
  5. Install OpenVR and XR Legacy Input packages
    1. In Unity's top menu, go to Window > Package Manager
    2. Select OpenVR and XR Legacy Input Handlers
    3. Close Package Manager
    4. Note: If using an older version of Unity, the Input Handlers are built in and will not need to be manually installed
  6. Set Project's Build Settings
    1. Go to File > Build Settings...
    2. Delete any scenes listed in the "Scenes in Build" area
    3. Click "Add Open Scenes" to add current scene to Build
    4. Change Platform to "Android" and set Texture Compression to "ASTC"
    5. Click on "Player Settings" and change:
      1. Company Name
      2. Product Name
    6. In Player Settings, go to:
      1. Other Settings > Identification > Change Minimum API Level to 4.4 KitKat
      2. Under Identification, confirm your Package Name is along the lines of com.company name.product name
      3. XR Settings and confirm "Virtual Reality Supported" is enabled
      4. Virtual Reality SDKs section, click on "+" and add "Oculus"
    7. Click "Build" in Build Settings
    8. If you receive error message, go to Player Settings > Other Settings > Graphics API > Remove Vulcan
  7. Setup Oculus Quest Controllers
    1. To represent controllers by spheres:
      1. Add 3D Object Sphere
      2. Change Sphere scale to 0.1 in X, Y, and Z
      3. Add Tracked Pose Driver component, set Device to "Generic XR Controller"
      4. Add RigidBody component, enable "isKinematic" and disable "Use Gravity"
      5. Duplicate Sphere and change Pose Source in Tracked Pose Driver to "Right Controller." Double check the other Sphere's Pose Source is set to "Left Controller"
    2. Change Spheres and Main Camera position to 0, 0, 0 in Inspector
  8. Setup VR scene
    1. Add 3D Object Cube
    2. Set Cube position to 0, 0, 1
    3. Add RigidBody Component and disable "Use Gravity"
    4. Save scene
  9. Launch Unity Project onto Oculus Quest
    1. Connect Quest to your computer via USB
    2. Put on Quest and enable USB debugging for this computer
    3. In Unity, go to File > Build Settings... > Build & Run
    4. Choose name for APK; Create new "Builds" folder and save APK within
    5. Once Unity has finished deploying project onto Quest, disconnect Quest and put on
    6. Access your project from Quest Main Menu > Libraries > Unknown Sources

Download Syllabus

Download XR Development with Unity Course Syllabus

Share this