Oculus Quest supported to track head and hands of an avatar.

In the Editor an Oculus Rift can be used for testing the scene even when the platform is set to Android. For final testing on the Oculus Quest, a build needs to be made and transferred to the Quest.

The easiest solution for building for Quest is to connect the Quest to the PC with an USB cable and then select Build And Run in the File menu of Unity. Please note that the Oculus Quest needs to have Developer Mode enabled for this (see https://developer.oculus.com/documentation/quest/latest/concepts/mobile-device-setup-quest/)

Prerequisites

Humanoid Control

Oculus Quest is supported in Humanoid Control VR, Plus and Pro version 2.2 and higher.

Operating System

Oculus Quest is supported on the Android platform. Ensure Android is selected as platform in Build settings

Setup

Pre Unity 2017.2: Virtual Reality Supported needs to be enabled in Edit Menu->Project Settings->Player->Other Settings. Oculus needs to be added to the Virtual Reality SDKs.

Unity 2017.2 and higher: Virtual Reality Supported needs to be enabled in Edit Menu->Project Settings->Player->XR Settings. Oculus needs to be added to the Virtual Reality SDKs.

Oculus needs to be enabled in the Edit Menu->Preferences->Humanoid->Oculus Support.

Disabling Oculus Support ensures that no code related to Oculus is included in the build.

Targets

To enable body tracking with the Oculus Quest for an avatar, Oculus needs to be enabled in the Humanoid Control component.

The Device Type needs to be set to Oculus Quest. This will ensure that the controllers in both hands will have positional tracking.

Head Target

First Person Camera needs to be supported for the Oculus Rift. For convenience, this option is also found on the Humanoid Control script.

Hand Target

The Oculus Controller needs to be enabled on the Hand Targets for controller support.

Oculus Quest Controller models are shown in the scene when Humanoid Control->Settings->Show Real Objects is enabled. These models can be moved in the scene to place the controllers to the right position relative to the hands of the avatar. A reference to these transforms is found in the Tracker Transform field.

Controller Input

The buttons of the Oculus Quest controller can be accessed using the Game Controller Input. The buttons are mapped as follows:

Left Controller
X button controller.left.button[0]
Y button controller.left.button[1]
Thumbstick touch controller.left.stickTouch
Thumbstick press controller.left.stickButton
Thumbstick movements controller.left.stickHorizontal/stickVertical
Index Trigger controller.left.trigger1
Hand Trigger controller.left.trigger2
Right Controller
A button controller.right.button[0]
B button controller.right.button[1]
Thumbstick touch controller.right.stickTouch
Thumbstick press controller.right.stickButton
Thumbstick movements controller.right.stickHorizontal/stickVertical
Index Trigger controller.right.trigger1
Hand Trigger controller.right.trigger2

Calibration

The tracking position and orientation can be calibrated during gameplay by calling the Calibrate() function on the Humanoid Control object. This is often implemented using the Controller Input component.