Home › Forums › Software Development › Unity Tobii GUI update
- This topic has 1 reply, 2 voices, and was last updated 8 years, 4 months ago by Grant [Tobii].
- AuthorPosts
- 24/03/2016 at 17:01 #4898John MartinezParticipant
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?
21/07/2016 at 15:46 #5442Grant [Tobii]KeymasterHi @memoryvandel, apologies that your thread was not answered previously.
May I enquire if you are still facing this issue?
- AuthorPosts
- You must be logged in to reply to this topic.