Skip to content

HannesLueer/EyeTracking-Unity-MetaQuestPro-Minimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity: Eye Tracking with Meta Quest Pro

This Unity project demonstrates the basic setup for eye tracking using a Meta Quest Pro headset. The project utilizes a GameObject named CenterEyeAnchor located under OVRCameraRig/TrackingSpace, which represents the center between both eyes. The individual eyes are represented by the GameObjects LeftEyeAnchor and RightEyeAnchor. The OVREyeGaze script attached to each of these rotates and moves the GameObject in the space. Among other things, the Confidence Threshold can be set here, which is necessary to determine the required confidence level for applying the detected change in the eyes to the object.

The CameraRay script, attached to the CenterEyeAnchor utilizes the position and rotation of the LeftEyeAnchor and RightEyeAnchor to calculate an average of the position and rotation of both eyes and use that to create a raycast. For debugging purposes, a visible line can be drawn by setting the drawDebugLine variable. Objects of the Highlighter class have their IsHovered variable set to true when looked at, allowing them to apply a different material accordingly. This is where other behaviors can be implemented, or interactions with other classes can be added in the CameraRay script when looking at these objects.

Usage

  1. Open the Unity project and then navigate to the SampleScene within it.
  2. Navigate to the OVRCameraRig in the hierarchy and locate the LeftEyeAnchor, CenterEyeAnchor and RightEyeAnchor GameObject.
  3. Adjust the Confidence Threshold parameter in the OVREyeGaze scripts attached to the LeftEyeAnchor and RightEyeAnchor GameObjects if necessary.
  4. Ensure you have the Meta Quest Pro headset connected and properly set up. (Check the connection in the Oculus app, and verify if the device is listed in Unity under File -> Build Settings -> Run Device.)
  5. Make sure that Android is selected as the platform in the build settings (File -> Build Settings -> Android -> Switch Platform). Run the Unity scene (File -> Build and Run).
  6. Look at the objects in the scene to trigger highlighting and see the eye tracking in action.
  7. Use this project to use eye tracking with Unity and Meta Quest Pro in your own project.

Additional Notes

  • For more complex interactions, consider extending the functionality of the Highlighter class or integrating interactions with other scripts when objects are being looked at.
  • Ensure proper calibration and positioning of the Meta Quest Pro headset for accurate eye tracking results.

Further Information

About

Eye Tracking with Meta Quest Pro in Unity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages