Meta Gaze Adapter
This sample is installed into the default location for package samples, in the Assets\Samples\XR Interaction Toolkit\[version]\Meta Gaze Adapter
folder. It provides a script to assist with eye tracking with the Meta Quest Pro and the XR Gaze Interactor.
Currently the XRGazeInteractor
uses the OpenXR bindings for eye gaze position, tracking, and rotation. This binding is not currently supported for Quest Pro. When the OpenXR bindings are supported, this sample and adapter will be unnecessary.
Asset | Description |
---|---|
OculusEyeGazeInputAdapter |
Script which creates an Eye Gaze input device and updates the device's state based on data from the Oculus OVRPlugin API. This script can be placed in a scene with an XR Gaze Interactor to enable the gaze interactor to work with the Meta Quest Pro eye tracking. |
GazeAdapterSampleProjectValidation |
Unity Editor script which adds Project Validation rules for the sample. Not necessary for the actual adapter. |
Requirements
The Oculus XR Plugin package version 3.2.2
or newer is required for Meta Quest Pro support, and thus this sample requires at least the Unity Editor 2021.3.4f1 or newer.
Additionally, this sample requires the OVRPlugin
found in the VR
folder of the Oculus Integration asset,
v47.0
or newer, and the OpenXR Plugin package version 1.6.0
or newer. The OpenXR EyeGazeDevice
is used to update the pose of the Gaze Interactor
.
Setup
- Download
v47.0
or newer of the Oculus Integration asset - Import the Oculus Integration asset by using Window > Package Manager > Packages: My Assets > Oculus Integration > Import or by using Assets > Import Package > Custom Package to import the downloaded
.unitypackage
file. At a minimum, select the following assets to import:Oculus\OculusProjectConfig.asset
Oculus\VR\
- Click Yes to accept the Update Oculus Utilities Plugin prompt to update OVRPlugin
- Click Use OpenXR to accept the OpenXR Backend prompt. If you canceled, enable it later using Oculus > Tools > OVR Utilities Plugin > Set OVRPlugin to OpenXR.
- Import Meta Gaze Adapter sample from Window > Package Manager > XR Interaction Toolkit
- Install or update OpenXR Plugin (com.unity.xr.openxr) to version
1.6.0
or newer and install or update Oculus XR Plugin (com.unity.xr.oculus) to version3.2.2
or newer by clicking Fix in Edit > Project Settings > XR Plug-in Management > Project Validation or by using Window > Package Manager - Add
USE_INPUT_SYSTEM_POSE_CONTROL
to Scripting Defines Symbols (Edit > Project Settings > Player > Other Settings > Scripting Compilation > Scripting Defines Symbols) and click Apply. Do this for both the PC and Android tabs in the Player settings. This resolves the error "ArgumentException: Expected control 'pose' to be of type 'PoseControl' but is of type 'PoseControl' instead!" - Enable Oculus plug-in provider in Edit > Project Settings > XR Plug-in Management. Do this for both the PC and Android tabs in the XR Plug-in Management settings.
- Add the Oculus Eye Gaze Input Adapter component to a GameObject in the scene
- (Android platform only) Enable Eye Tracking Support in the Inspector window of the
Assets\Oculus\OculusProjectConfig
asset under section Quest Features > General by setting it to Supported or Required
Tip
To enable eye tracking support while using Oculus Link, open the Oculus desktop application and go to Settings > Beta. Click to enable Developer Runtime Features and Eye tracking over Oculus Link. Then click Restart Oculus, then unplug and plug in the USB cable. Finally, restart the Unity Editor.
Optional
- Enable Quest Pro under Target Devices in the Oculus settings Android tab in Edit > Project Settings > XR Plug-in Management > Oculus
- Generate custom Android manifest file (Oculus > Tools > Create store-compatible AndroidManifest.xml to update
Assets\Plugins\Android\AndroidManifest.xml
, which also automatically updates Edit > Project Settings > Player > Android tab > Publishing Settings to enable Custom Main Manifest