Home Forums Unity SDK Getting gazed object position data

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18995
    Yotam Hagur-Bahat
    Participant

    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

    #19002
    Grant [Tobii]
    Keymaster

    Hi @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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.