Sitemap

Unity VR: Simple Gaze Interactor

3 min readMay 14, 2025

--

Intro

In this article, we are going to cover how to add a simple Gaze Interactor to the XR Right. Gaze Interactors are a type of XR Interactor that allow users to interact with objects by looking at them, typically used in hands-free or controller-free VR/AR experiences.

Gaze Interactor

A Gaze Interactor enables object interaction using head or eye direction. While the Quest 2 lacks eye tracking, other headsets do support this feature. This interactor works by casting rays forward from the head or camera to identify visible XR Interactables. Depending on the Interactor Events configuration, users can hover, select, or activate these objects simply by looking at them, similar to other interactor types.

Setup

For XRI Toolkit 3.x, the setup may vary from earlier versions. To implement the Gaze Interactor, create a new empty game object and parent it to the Main Camera. Position this new object with your desired offset relative to the camera. Since the Main Camera is already tracked using the Tracked Pose Driver (from the Input System), the Gaze Interactor will now move in conjunction with the Main Camera’s tracked pose.

Attach a XR Gaze Interactor to this game object and you will see how it is very similar to other XR Interactor, with the exception of the Gaze Configuration. These settings improve the precision and usability of gaze-based interactions, especially for UI or small objects.

  • Gaze Assistance Snap Volume — Helps auto-target nearby interactables
  • Gaze Assistance Calculation — Defines how the interactor determines hit points
  • Gaze Assistance Fixed Size — Keeps the snap volume size constant in world space
  • Gaze Assistance Collider Scale — Scales up colliders for easier hit detection
  • Gaze Assistance Distance Scaling — Scales snap volume based on how far the target is

This interactor uses a Raycast to draw a line from the Gaze Interactor in a and detects anything it hits anything in the scene.

Since I do not want this Interactor to interact with everything, we can create and set an Interaction Layer for just the Gaze Interactor.

Gaze Interactable

For game objects that you want to be interactable with the Gaze Interactor, you attach a XR Simple Interactable and Collider components to the game object.

Match the Interaction Layer Match to the same layer as the Gaze Interactor and enable ‘Allow Gaze Interaction’ under the Gaze Configuration.

From there, you can add different Events when the interaction takes place.

Conclusion

The example below shows the player must put the crown on before enabling the Gaze Interaction on the mirror. Once the Gaze Interaction happens the taco turns into a key which can be used to unlock the door.

Gaze Interactors provide a way to interact with objects in VR using just the headset and the direction it is facing.

--

--

No responses yet