CLAP for Oculus Quest

CLAP can be used with the hand tracking system of Oculus Quest. In this tutorial we show how to deploy a sample CLAP scene for the Oculus Quest (1 & 2). In order to create applications for Oculus Quest with Unity, make sure your Unity installation has Android Build Support enabled.

1. Open sample scene

To open a Quest sample scene, browse to Packages/CLAP/Scenes/. Here you will find a number of sample scenes. To open a sample scene for the Oculus Quest, just open scene ‘3-QuestOneHand’. The inspector shows that the OVRCameraRig prefab is missing. This is caused by the fact that the Oculus Asset is not added to the project.

2. Updating build settings

Before we import the Oculus Asset, we first have to change some build and player settings. Since the Oculus Quest is an Android device, we have to change the platform to Android. Open the Build Settings (menu: File->Build Settings) and include the current scene by clicking on the ‘Add Open Scenes’ button. Next, click on ‘Android’ and then click on the ‘Switch Platform’ button.

3. Updating project settings

Next, open the Player Settings by clicking on the ‘Player Settings’ button in the lower left corner (or Menu: Edit->Project Settings and then click on Player). Search for ‘Other Settings’ in the Android tab and change the Color Space from ‘Gamma’ to ‘Linear’ and confirm this.

Finally, we need to add the XR Plugin Management. Click on ‘XR Plugin Management’ on the left, and click on ‘Install XR Plugin Management’.

Next, enable the Oculus checkbox under the Android tab, which will install the Oculus XR plugin:

4. Install Oculus asset

In the scene hierarchy, the OVRCameraRig prefab is still missing. To fix this, we need to install the Oculus Integration asset. Go to the Oculus Integration page in the Asset store and click ‘Add to My assets’. After this you will be able to click on ‘Open in Unity’. This opens the Package Manager window:

Note that in Unity 2019 the Asset store is accessible from the Unity editor, but in Unity 2020 this is not possible and a browser should be used to access it.

After clicking on the ‘Download’ button, the asset will download and it will appear the ‘Import’ button. Click on the ‘import’ button. After a while Unity asks which files to import. Import all files by clicking on ‘Import’.

This will add the Oculus Integration asset to your project, which may take a while to finish. Once this asset is imported, several messages can appear:

  • Unity asks to update the OVRPlugin: click Yes.
  • If you are using Unity 2020, a message will appear asking to use the OpenXR backend in their plugin. It’s safe to click on ‘Use OpenXR’ and confirm this by clicking on ‘Ok’ after that.
  • When Unity asks to upgrade the the spatializer plugin, just click on ‘Upgrade’.

At some point of this process, Unity will ask for a restart. Don’t hesitate and click ‘Restart’.

After the restart, you will now notice that the missing prefab in the hierarchy is recovered by adding the Oculus Integration Asset.

5. Changing default settings in OVRCameraRig prefab

Select the OVRCameraRig prefab from the hierarchy and go to the OVRManager script settings in the inspector. Change ‘Hand Tracking Support’ to ‘Hands Only’ or ‘Controllers and Hands’.

6. Building and running Android package.

Now that everything has been setup correctly, it’s time to actually build the Android package and run it on the Quest. Make sure your Quest is in developer mode, i.e., that you can install your own packages. Connect the Quest to your PC and make sure that you ‘allow USB debugging’ when is asked in the device. Now, open the Build Settings window and make sure your device is listed in the drop down menu next to ‘Run Device’.

If that is the case, just click on ‘Build and Run’. Give a name for your apk file and click on save. Unity will now build the Android package, which may take some time. If there are no problems, then the package will be installed on the Quest and will start immediately. You can now put on the HMD and play around with CLAP.

👏 👏 👏