Kodiak Posted June 4, 2021 Share Posted June 4, 2021 Hi, Fairly new to all of this VR tracking, in short I want to know where the using is looking, and also what object they are looking at and printing this out to the debug console.  Thank you in advance 🙂 Link to comment Share on other sites More sharing options...
JD Wilder Posted June 8, 2021 Share Posted June 8, 2021 Look at the API for GetGazeRay Here is one entry for that:  static bool GetGazeRay (GazeIndex gazeIndex, out Vector3 origin, out Vector3 direction, EyeData_v2 eye_data)  What it does is gives you the direction the eyes are looking in the vector "direction". If you want to know what the object is looking at you can take the direction vector, and the origin of the vector and use RayCast to see if the gaze ray is hitting any colliders. Or, it will be easier to use the focus method:  static bool Focus (GazeIndex index, out Ray ray, out FocusInfo focusInfo, float radius, float maxDistance, int focusableLayer, EyeData_v2 eye_data)  which will tell you if any colliders are being looked at, and tells you the nearest collider that they gaze hits. focusInfo will contain all of the information about what is being looked at. @Kodiak @Corvus Link to comment Share on other sites More sharing options...
Kodiak Posted June 9, 2021 Author Share Posted June 9, 2021 Thank you will take a look into this and see how i get on 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now