Veggie Saber – Introduction to Unity Development with the Oculus Quest

In this tutorial, you’ll learn how to develop and deploy a game for Oculus Quest in Unity by developing Veggie Saber, a Saber VR game featuring tasty veggies! By Matt Larson.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Deploying on the Oculus Quest

So your VR game works on your PC, but you want to get it onto your untethered VR device. Here are the steps you need to take to deploy your game on the Oculus Quest.

Enabling Developer Mode via App

To create apps for the Oculus Quest, you need to register an account with Oculus, then turn on the developer mode on the Quest as follows:

  1. Create a developer account and setup an organization to enable developer mode on the device. To do this, visit https://developer.oculus.com/ and create a new account via ‘login’.
  2. Install the Oculus app for an Android or iPhone to pair with the Quest device.
  3. From the Oculus app, go to Settings ► Advanced Settings. On this page, enable developer settings.

Building the APK Package

Your next step is to get your APK package up and running. To do it, take the following steps:

  1. Go to File ► Build Settings.
  2. Make sure that VeggieSaber is the only scene.
  3. Select Android as your platform.
  4. Click Switch Platform to update the project before building.
  5. Switch Texture Compression to ASTC. ASTC compression is recommended for the Oculus Go and Quest, but ETC2 is another option.
  6. Select Run Device and change to Oculus Quest.
  7. Click on Player settings, then go to Settings for Android and set the Splash Image, Virtual Reality Splash Image to RayWenderlichLogo.png to provide a splash screen while loading.
  8. Under Player settings ► Other settings in Graphics API, remove the Vulcan API and make sure that OpenGLES3 is the first option.
  9. Find Package Name and set this to com.rw.veggiesaber. This is what the Java package for the program will show when running on the Oculus Quest.
  10. In the Player Settings, under Other Settings, set the Minimum API Level to Android 6.0 Marshmallow, API Level 23.
  11. Make sure that Player Settings ► XR Settings still has Virtual Reality Supported enabled and that you’ve included the Virtual Reality SDK (Oculus).
  12. Under the Oculus entry, enable the setting “V2 Signing(Quest)”, which is needed to create the AndroidManifest.xml correctly to support both Quest controllers. If this setting is missing, make sure that you have switched to the Android build platform and then update the Oculus(Android) package to version 1.38.4 or later by going to Window->Package Manager and downloading the latest Oculus(Android) package.
  13. Return to the Build Settings, then select Build. When asked, save the build output as VeggieSaber.apk.

Sideload the App to the Quest

Connect the Oculus Quest with the USB-C cable to your computer. If your computer does not have a USB-C port, you’ll need to get a USB-C to USB-A cable.

Download the Android [Platform-Tools] package and unzip it.

Using Terminal (for Mac) or Command Prompt (for Windows), navigate to the opened directory containing the executable ‘adb’ using the following command:

cd ADB_Directory

Replace ADB_Directory with the path to your adb folder.
The Android Debug Bridge (adb) provides the way to deploy the built software to the Oculus Quest device. With your Oculus Quest connected, you can now type:

adb devices

Which should display a message such as ‘1PASXXXXXH9114 unauthorized’. Now, put on the Oculus Quest headset and it will ask whether to trust this computer. Accept and select always allow for this PC.

Now, when you type adb devices, the message will change to:

‘1PASXXXXXH9114 device’

It’s now ready to accept your deployed software.

Install Veggie Saber on the Oculus Quest

While still in the Console or Command Prompt, enter the following command and press enter:

‘adb.exe install [path to VeggieSaber.apk]

When this command completes… congratulations! You’ve installed your first game on the Oculus Quest!

You can start playing by putting on the headset, navigating to Library ► Unknown Sources and selecting com.rw.veggiesaber to launch the app.

Where to Go From Here?

If you’d like to know more about developing experiences for VR using the latest in Unity features and tools, here are some links:

  1. Oculus Integration for Unity provides the Oculus OVRPlugin and scripts for controller and headset input, and helper utilities such as setting the floor height. Get more details here: Oculus Integration.
  2. Learn more about building custom effects with the Shader Graph and Lightweight Rendering Pipeline: Unity Shader graph.
  3. Learn about optimizing for VR experiences with Unity VR and AR by Tutorials.

Thanks for reading through this tutorial. If you have any questions or comments, feel free to ask in the forums or to leave a comment below!