Eye Gaze Overview
Unity developers can use the OpenXR Eye Gaze Interaction Profile to determine what a user is looking at, allowing a hands-free method of interacting with their application. To access the Eye Gaze data, the interaction profile needs to be enabled in your project's OpenXR Settings (Window > XR Plugin Manager > OpenXR Settings).
Before using Eye Tracking Input, you can utilize the User Calibration OpenXR feature to ensure the wearer has properly calibrated eye tracking and a well-fitted headset. This will ensure that the user's gaze is accurately detected.
If the User Calibration API indicates a “Bad Fit” or if the eyes are uncalibrated, we recommend notifying the user and prompting them to run the eye calibration. You can launch the eye calibration application using standard Android intents. Please refer to this article for more details.
If your Application collects, stores, transfers or otherwise uses data off the Magic Leap 2 device that is received via this API, then you must comply with the Magic Leap 2 Eye Tracking Data Transparency Policy.
This features requires the EYE_TRACKING
permission to be requested at runtime and enabled in your project's Manifest Settings (Edit > Project Settings > Magic Leap > Manifest Settings).
📄️ Input Bindings
This guide provides information on the input paths that are supported on Magic Leap 2 when using the OpenXR Eye Gaze Interaction Profile. For general information about OpenXR input in Unity, see the Unity OpenXR Plugin Input Manual.
📄️ Eye Tracking Tracked Pose Driver
If your Application collects, stores, transfers or otherwise uses data off the Magic Leap 2 device that is received via this API, then you must comply with the Magic Leap 2 Eye Tracking Data Transparency Policy.
📄️ Input Device Feature Values
It is recommended that developers use the Unity Input System to obtain the Gaze Input. However, developers can also obtain eye tracking input directly from the InputDevice. This section provides an example of how to read input using the TryGetFeatureValue method and EyeTrackingUsages features.