30-04-2021



  1. Oculus Quest Unity Sdk
  2. Oculus Quest Unity
  3. Oculus Quest Unity Template
  4. Oculus Quest Unity Urp
-->

A Oculus Quest is required.

Oculus Quest Unity Sdk

MRTK's support for the Oculus Quest comes via two different sources, Unity's XR pipeline and the Oculus Integration Unity package. The Oculus XRSDK Data Provider enables the useof both sources and must be used to use MRTK on the Oculus Quest.

The Unity's XR Pipeline enables the use of Oculus Touch controllers and head tracking with the Oculus Quest.This pipeline is the standard for developing XR applications in Unity 2019.3 and beyond. To use this pipeline, make sure that you using Unity 2019.3 or newer.

How to debug Oculus Quest games with Unity in realtime and in the Headset.-TWITTER: http://timokorinth.de/FACEBOO. Get the project on patreon: Join the discord channel: tutorial to make your first Oculus Que. Oculus air link - unity quest development. Posted by just now. Oculus air link - unity quest development. Just in case anybody was wondering - I've tested it today and air link works fine for testing your games in unity! I guess it was to be expected considering. The Unity Profiler tool can be used to collect performance information about your app by building and running it on Oculus Quest. Unity Profiler can be useful for developers that want to profile performance directly from the Unity development environment. This guide gives you the steps to connect your app to Unity Profiler and get started with collecting data. The order forms a structured process in itself, which helps you kick-start the development setup and familiarize with Oculus and Unity fundamentals. Depending on your need and level of expertise with Oculus app development and Unity features and interface, you can choose to follow the order from start to finish, or use it as a standalone reference.

The Oculus Integration Unity package allows for the use of hand tracking with the Oculus Quest.This data provider does NOT use Unity's XR Pipeline or Legacy XR Pipeline, but because controllers and headtracking are handled by the Unity's XR Pipeline, the steps inSetting up project for the Oculus Quest must be followed to ensure that you are using the XR Pipeline and not the to-be-deprecated Legacy XR Pipeline.

Setting up project for the Oculus Quest

  1. Follow these steps to ensure that your project is ready to deploy on Oculus Quest.

  2. Ensure that developer mode is enabled on your device. Installing the Oculus ADB Drivers is optional.

Setting up the XR Pipeline for Oculus Quest

  1. Ensure that the Oculus XR Plugin is installed under Window --> Package Manager

  2. Make sure that the Oculus Plug-in Provider is included in your project by going to Edit --> Project Settings --> XR Plug-in Management --> Plug-in Providers

Setting up the Oculus Integration Unity package to enable handtracking

  1. Download and import Oculus Integration from the Unity Asset Store. The latest version tested towork is 20.0.0. Older versions can be found from this archive

  2. Navigate to Mixed Reality Toolkit > Utilities > Oculus > Integrate Oculus Integration Unity Modules. Doing this will update the asmdefs with definitions and references needed for therelevant Oculus Quest code to function. It will also update the csc file to filter out the obsolete warnings produced by the Oculus Integration assets. The MRTK repo contains a csc file that converts warnings to errors, this conversion halts the MRTK-Quest configuration process.

  3. In the imported Oculus folder (It should be found at Assets/Oculus), there is a scriptable object called OculusProjectConfig. In that config file, you need to set HandTrackingSupportto 'Controllers and Hands'.

Setting up the scene

  1. Create a new Unity scene or open a pre-existing scene like HandInteractionExamples
  2. Add MRTK to the scene by navigating to Mixed Reality Toolkit > Add to Scene and Configure

Using the Oculus XR SDK Data Provider

  1. Configure your profile to use the Oculus XR SDK Data Provider

    • If not intending to modify the configuration profiles

      • Change your profile to DefaultXRSDKConfigurationProfile and go to Build and deploy your project to Oculus Quest
    • Otherwise follow the following:

      • Select the MixedRealityToolkit game object in the hierarchy and select Copy and Customize to clone the default mixed reality profile.
      • Select the Input Configuration Profile
      • Select Clone in the input system profile to enable modification.
      • Open the Input Data Providers section, select Add Data Provider at the top, and new data provider will be added at the end of the list. Open the new data provider and set the Type to Microsoft.MixedReality.Toolkit.XRSDK.Oculus > OculusXRSDKDeviceManager
  2. The Oculus XR SDK Data Provider includes an OVR Camera Rig Prefab which automatically configures the project with an OVR Camera Rig and OVR Hands to properly route input. Manually adding an OVR Camera Rig to the scene will require manual configuration of settings and input.

Build and deploy your project to Oculus Quest

  1. Plug in your Oculus Quest via a USB 3.0 -> USB C cable

  2. Navigate to File > Build Settings

  3. Change the deployment to Android

  4. Ensure that the Oculus Quest is selected as the applicable run device

  5. Select Build and Run

    • You will likely encounter the following set of build errors when you select Build and Run the first time. You should be able to successfully deploy upon selecting Build and Run again.
  6. Accept the Allow USB Debugging prompt from inside the quest

  7. See your scene inside the Oculus Quest

Removing Oculus Integration from the Project

  1. Navigate to the Mixed Reality Toolkit > Oculus > Separate Oculus Integration Unity Modules
  2. Let Unity refresh as references in the Microsoft.MixedReality.Toolkit.Providers.Oculus.asmdef and other files are modified in this step
  3. Close Unity
  4. Close Visual Studio, if it's open
  5. Open File Explorer and navigate to the root of the MRTK Unity project
  6. Delete the UnityProjectName/Library directory
  7. Delete the UnityProjectName/Assets/Oculus directory
  8. Delete the UnityProjectName/Assets/Oculus.meta file
  9. Reopen Unity

Oculus Quest Unity

Common errors

Quest not recognized by Unity

Make sure your Android paths are properly configured. If you continue to encounter problems, follow this guide

Edit > Preferences > External Tools > Android

My students and I have been very active in creating projects for VR over the past few years. Testing these projects on a system with a connected Vive or Oculus Rift was fairly straight forward and didn’t involve a lot of steps. With the availability of the Oculus Go and Oculus Quest, the steps have increased but can still be done easily if you know the correct procedures.

In this tutorial, we will do a full walkthrough of configuring your Unity project for the Oculus Quest or Go and how to publish. If you prefer a video tutorial, scroll to the bottom!

Getting Started
For this project, we used Unity 3D Personal Edition 2019.2.10. We created a game environment of our classroom building as a way to promote our top-ranked Game Design program. The project was initially designed to be deployed to a mobile device. Everything worked great on the mobile, so we then added the Oculus tools to Unity and reconfigured to deploy to Oculus Quest and Oculus Go.
In this walkthrough, I am deploying from a MacBook Pro. Everything works the same when deploying from Windows.

Set Developer Mode on your phone/tablet

Step 1 is to place your Oculus Quest or Go into Developer Mode. This is task must be completed on the phone or tablet that is associated with your Oculus Quest or Go. Note that developer mode did not ‘stick’ the first time we set it to on. After several attempts to connect to the Quest, I check the setting again and found that it was off. Once I changed developer mode back to on, it connected to the laptop without a problem.

Step 1A: Connect to your Quest or Go with your phone or tablet. Select … More Settings

Step 1B: Select Developer Mode from the list

Step 1C: Change Developer Mode to On.

You should now be able to connect your quest or go device to your laptop or desktop system with a USB cord. You will be asked on the VR device to approve the connection.

Install Android Tools

Step 2: You will need Android Tools to be able to deploy to a Quest or Go device. At a minimum Android version SDK 19 (Android 4.4 or KitKat) and Android version SDK 25 (Android 7.1.1 Nougat) should be installed. This can be accomplished by installing Android Studio.

Once installed, you will need to add the SDKs by clicking on Configure at the bottom of the Start screen and selecting SDKs. Once you are in the Settings window, select Android 4.4 and Android 7.1.1, then click Apply.

After the installation of the Android SDKS, select the SDK Tools tab and make sure that Android SDK Tools and Android SDK Platform-Tools are applied to your installation.

Finally, if you are working on a Windows computer, you will need the Oculus ADB drivers: https://developer.oculus.com/downloads/package/oculus-adb-drivers/

Android Tools in Unity

Step 3: To build for Quest and Go you must include the Android module in your Unity installation. To ensure proper installation, I recommend launching Unity Hub in Administrator mode (right-click on the app and choose Run as Administrator). This seems to ensure that the needed Android files are installed correctly. Make sure that Android SDK & NDK Tools are selected.
If you are upgrading a project (which is what I am doing), you will need to add the Android module to the build of Unity if it is not already installed.

Make sure that Android SDK & NDK Tools are selected under Android Build Support.

Project Build Settings

Step 4: Open or create your Unity Project.

Set the Platform to Android in Build Settings (File > Build Settings). If you are converting an existing project to Android, this may take some time as Unity converts the project.
Make sure you have added the Scene to the Scenes in Build.

Once you have changed the Project to Android in Build Settings, Click on the Player Settings button in the bottom left corner of the Build Settings. Scroll down to Other Settings.
Under Identification, type in the Package Name using reverse Java notation (com.business-url.projectname) and set the Minimum API Level to Android 4.4.

Finally, still in Player Settings, scroll to the bottom and select XR Settings.
Click the checkbox on for Virtual Reality Supported. If Oculus is not listed in the Virtual Reality SDKs, click the + button and add Oculus. Then select V2 Signing (Quest).

Close the Player Settings and Build Settings windows. It’s time to get into the project!

Oculus Quest Unity Template

Before you get busy building your scene, we recommend adding the Oculus Controller to the Hierarchy of your project. This is the controller for the player’s view of the environment, and where we are able to control whether we are building for Oculus Quest or Go.

If you haven’t already, download the Oculus Integration from the Asset Store. Oculus updates this asset regularly, so make sure you are using the latest version.

In your Asset folder, go to the Oculus Asset package > VR > Prefabs folder and select the OVRPlayerController. Drag it into your Hierarchy.

Place the Controller where you want the player to start in the scene. If you are starting with a blank scene, this isn’t critical, but if you are working with a developed scene, the start location is important for your player.

Once you have the OVRPlayerController in the scene, you can configure the target VR device: Oculus Quest or Oculus Go.
Open the OVRPlayerController in the Hierarchy and select the OVRCameraRig child object. In the Inspector find the OVR Manager (Script). Under Target Devices select either Quest or Gear VR or Go.


That’s it, you have configured the basic settings for your VR equipment.

Note that we have not configured the controllers or movement. In our tests, we were able to move with the thumb directional controllers on the Quest but had no movement with the Oculus Go. We will address configuring the Controllers in another post.

Oculus

Lighting
When exporting to a Quest or Go, you CANNOT use Realtime Global Illumination. All lighting must be baked into the scene. Ensure that Realtime Global Illumination is not selected in your Lighting panel (Window > Rendering > Lighting Settings).
We found a huge performance boost by using the Progressive GPU (Preview) setting in the Lightmapping Setting.
Also, if you have a large scene with a lot of lights, be sure to turn the Auto Generate to Off.

Testing the App on an Oculus Quest or Go
There are several ways to test your app on the quest. You can do a Build & Run in Unity. Assuming that your Quest is properly connected, you should see the app running on the device.

If you want to place the game on the device without being tethered to a computer, you will need to do a build. A build will generate an APK file (Android Package), which is the reason we had to install all of the Android files at the beginning of this tutorial.

Building and Sideloading

Sideloading is the procedure to place the APK on a Quest or Go. We have shifted to using SideQuest rather than adb to handle Sideloading. SideQuest is an opensource project that works equally well on Windows and Mac.

Once you have your Oculus connected via USB to your computer, drag the APK file on to the SideQuest log in the top left of the app. SideQuest will take care of the rest of the installation.

Once SideQuest finishes, you will find the project in the Unknown Sources tab.

As previously mentioned, this process will get the app installed onto your Oculus Quest or Oculus Go device. There will still be a lot to do to get everything working smoothly and efficiently on the device.
Watch for more tutorials on working with the Oculus Interaction package to improve your app!

Troubleshooting
We ran into the problem that the Oculus Quest Developer Mode turned off after a while. If you are having problems connecting to your Quest, double-check developer mode.

Oculus Quest Unity Urp

UPDATE: With the more recent releases of Unity and Oculus tools for Unity, Oculus Go is no longer a selection option. Oculus Quest builds do not work on Oculus Go.