Home Forums Software Development Unity Tobii GUI update

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4898
    John Martinez
    Participant

    I’m having an issue with a Gui being placed on screen. Firstly it works perfectly in the Editor if the scene that uses eye tracking is loaded. This is the code being used:

    void Update ()
    {
    if (_gazePointDataComponent == null)
    {
    Debug.Log(“PRINT”);
    }
    var lastGazePoint = _gazePointDataComponent.LastGazePoint;
    if (_userPresenceComponent.IsValid && _userPresenceComponent.IsUserPresent && lastGazePoint.IsValid)
    {
    var gazePointInScreenSpace = lastGazePoint.Screen;
    var smoothedGazePoint = Smoothify(gazePointInScreenSpace);
    }
    else
    {
    _hasHistoricPoint = false;
    }
    }

    void OnGUI()
    {
    GUI.DrawTexture(new Rect((transform.position.x – 64), Screen.height – (transform.position.y + 64), cursorWidth, cursorHeight), cursorImage);
    }

    transform.position = smoothedGazePoint;

    However if the Editor’s scene is the Main Menu (where eye tracking is not present) and in playing then selecting a level where this is present gaze tracking works functions however the gui is drawn but does not then relocate to the gazepoint.

    this is also the case when the game is built. eye tracking is working just the gui does not update its location. I have no errors or warnings, thoughts?

    #5442
    Grant [Tobii]
    Keymaster

    Hi @memoryvandel, apologies that your thread was not answered previously.

    May I enquire if you are still facing this issue?

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