XR / Spatial Computing

Eye Tracking in XR: Getting Started

Gaze data isn't just for foveated rendering. It's also one of the fastest, least-intrusive ways to let a user select something in VR or AR without a controller.

Eye tracking arrived in consumer XR headsets for a performance reason: foveated rendering, which renders the area the eye is actually pointed at in full detail and lets peripheral vision get away with less, cutting GPU load significantly without the user noticing a quality drop. Once that tracking hardware was already in the headset, though, it turned out to be useful for something else entirely: letting a user select or target something just by looking at it, often faster and with less physical effort than reaching for a controller.

What’s actually available right now

Meta Quest Pro and Quest 3 expose eye tracking through Meta’s own SDK, gated behind user permission the same way camera or microphone access is on a phone. Apple Vision Pro uses gaze as its primary selection mechanism by default, pairing a look with a pinch gesture instead of a controller point-and-click. Most Vision Pro apps are built around that interaction model from the ground up, rather than having it bolted on afterward. PlayStation VR2 also ships eye tracking, exposed through Sony’s own PSVR2 SDK rather than OpenXR. Not every headset has it: most standalone and PC headsets below the premium tier still skip the hardware entirely, so always check for the specific extension or capability flag before building a feature that assumes it’s there.

OpenXR’s eye-gaze-interaction extension

For a cross-platform approach, OpenXR defines XR_EXT_eye_gaze_interaction, which exposes gaze as a standard input action, the same way a controller trigger or thumbstick is exposed, rather than as a raw stream of eye-tracking data you have to interpret yourself. That matters practically: it means gaze can plug into the same input-action system most OpenXR apps already use for other inputs, instead of requiring a separate gaze-specific code path.

// Querying the gaze pose via XR_EXT_eye_gaze_interaction
XrEyeGazeSampleTimeEXT gazeSampleTime{XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT};
XrSpaceLocation gazeLocation{XR_TYPE_SPACE_LOCATION, &gazeSampleTime};
xrLocateSpace(gazeActionSpace, baseSpace, predictedDisplayTime, &gazeLocation);
// gazeLocation.pose now holds the gaze ray's origin and orientation

Support for the extension varies by runtime, so check your target headset’s OpenXR conformance listing before assuming it’s available.

Getting a basic gaze-select working in Unity

Unity’s XR Interaction Toolkit supports gaze-based interaction through its XRGazeInteractor component, which works much like the toolkit’s ray-based controller interactor except the ray originates from the eyes rather than a controller. Add it to a GameObject, point it at an XRBaseInteractable with a collider, and a sustained gaze beyond a configurable dwell time triggers a hover and, if you wire it up, a select event, all without the user’s hands doing anything.

Getting it working in Unreal Engine

Unreal exposes eye tracking through its Eye Tracker plugin, built on top of each platform’s own gaze API underneath. Enable the plugin, then call GetEyeTrackerGazeData() from Blueprint or C++ to retrieve a gaze origin and direction each frame, which you can then raycast against your scene the same way you’d raycast a mouse click.

The dwell-time problem every gaze interface has to solve

The hardest design problem in gaze interaction isn’t technical, it’s perceptual: eyes move constantly and land on things you have no intention of selecting, so a naive “select whatever you’re looking at” system fires constantly by accident. Nearly every working implementation solves this with some version of dwell time, requiring the gaze to hold steady on a target for a set duration, often a few hundred milliseconds, before counting it as a selection, or pairs gaze with a secondary confirming action, a pinch, a button press, a voice command, the way Vision Pro pairs gaze with a pinch rather than treating a look alone as a click.