Home › Forums › Unity SDK › Can I get gaze position in full screen coordinates? › Reply To: Can I get gaze position in full screen coordinates?
19/06/2020 at 14:22 #18218
Grant [Tobii]
Keymaster
Hi @trejkaz, glad that you managed to find a workaround. You may also consider this less invasive approach.
TobiiHost.cs
private void TrackWindow()
{
if (_gameViewBoundsProvider.Hwnd != IntPtr.Zero)
{
---> Replace this line //TobiiGameIntegrationApi.TrackWindow(_gameViewBoundsProvider.Hwnd);
---> With this code:
var trackers = TobiiGameIntegrationApi.GetTrackerInfos();
if (trackers.Any())
{
TobiiGameIntegrationApi.TrackTracker(trackers[0].Url);
}
---
IsInitialized = true;
}
}
This will thereafter always provide fullscreen coordinates
However, it will display incorrectly in the editor since remapping functions will work incorrectly
as the default SDK works fine in the editor with default layout and 1:1 Scale (zoom)
Something to bear in mind is that this code will always connect to the first tracker it finds in the system and may fail if using a VR tracker or two eye trackers.
Hopefully, this information is of use! Best wishes.