The Windows Mixed Reality plugin doesn’t provide any built-in functions for gaze input, but HoloLens 2 does support eye tracking. The actual tracking features are provided by Unreal's Head Mounted Display and Eye Tracking APIs and include:
- Device information
- Tracking sensors
- Orientation and position
- Clipping panes
- Gaze data and tracking information
Eye tracking is only supported on HoloLens 2.
Enabling eye tracking
Gaze input needs to be enabled in the HoloLens project settings before you can use any of Unreal's APIs. When the application starts you'll see a consent prompt shown in the screenshot below.
- Select Yes to set the permission and get access to gaze input. If you need to change this setting at any time, it can be found in the Settings app.
HoloLens eye tracking in Unreal only has a single gaze ray for both eyes instead of the two rays needed for stereoscopic tracking, which is not supported.
That's all the setup you'll need to start adding gaze input to your HoloLens 2 apps in Unreal. More information on gaze input and how it affects users in mixed reality can be found at the links below. Be sure to think about these when building your interactive experiences.