Tagged: Get gazed (focus) position
- This topic has 1 reply, 2 voices, and was last updated 3 years, 11 months ago by Grant [Tobii].
- AuthorPosts
- 06/10/2020 at 11:51 #18995Yotam Hagur-BahatParticipant
Hello, I am using the HTC VIVE PRO with TOBII eye tracker. I am trying to get the position of the gazed object. I followed the instructions in the developer zone (https://developer.tobii.com/pc-gaming/unity-sdk/scripting-api/#tobiiapigetgazepoint) but both functions ‘GetFocusedObject’ and ‘GetGazedPoint’ doesn’t work for some reason. I installed both TobiiXR and Tobii (SDK) packages and wrote a script with the two functions. but I don’t get the prints. Here is the script :
***
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Tobii.Gaming;public class TobiiGaming : MonoBehaviour
{void Update()
{
GazePoint gazePoint = TobiiAPI.GetGazePoint();if (gazePoint.IsRecent())
{
print(“Gaze Point On Screen (X,Y) ” + gazePoint.Screen.x + “, ” + gazePoint.Screen.y);
}GameObject focusedObject = TobiiAPI.GetFocusedObject();
if (null != focusedObject)
{
print(“The focused game object is: ” + focusedObject.name + ” (ID: ” + focusedObject.GetInstanceID() + “)”);
}}
}
***Please advise
07/10/2020 at 11:25 #19002Grant [Tobii]KeymasterHi @yotam, on order to use eye-tracking with the HTC VIVE PRO, you need to use the XR Unity SDK whilst it appears from your code you are using the Unity SDK for Desktop API.
You can download the appropriate SDK for your hardware @ https://vr.tobii.com/sdk/develop/unity/ which comes with the appropriate tutorial and getting started guide.
Please go through this and let us know how you get on. Best Wishes.
- AuthorPosts
- You must be logged in to reply to this topic.