Nov 14 2023 03:42 AM
Hi,
I am trying, in Unity, to export Eye gaze data, (preferably as coordinates relative to a 2D plane placed in front of the user).
The initial and main problem though is that I don’t know how to access said data through Unity.
I have read that I should first of all import
using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input;
Correct?
However, it gives me an error in the second line of code:
Error CS0234 The type or namespace name ‘Input’ does not exist in the namespace ‘Microsoft.MixedReality.Toolkit’ (are you missing an assembly reference?).
I initialized the project with MixedRealityFeatureTool, already importing the MRTK3 libraries (+XRplugin).
Are there any solutions to get the gaze data directly from Unity?
Any other ways?
Thank you!
Nov 26 2023 09:34 PM
To access eye gaze data in Unity using the Microsoft Mixed Reality Toolkit (MRTK), you need to use the EyeTracking namespace, not Input. The error you are encountering indicates that the Input namespace does not contain the necessary types for eye gaze tracking.
Here's an example of how you can access eye gaze data in Unity using MRTK:
In this example, we subscribe to the OnUpdated event of the EyeGazeProvider to receive updates on the eye gaze data. The OnEyeGazeUpdated method is called whenever the eye gaze data is updated, and you can access the gaze position and direction from the EyeTrackingEventData.
Make sure that you have the necessary MRTK packages installed, and that your project is configured to use MRTK for eye tracking.
Click here: benny beach buggy racing