- This topic has 1 reply, 2 voices, and was last updated 4 years, 9 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › XR Discussions › Check manually if an object is in focus
Tagged: Focus, GazeFocusChanged, IGazeFocusable, VR
Hi,
I’m doing some simulation with VR and Tobii eyetracking. I want to check if an object is in focus at a particular time. I have only found in the examples how to check when the gaze has changed with
public void GazeFocusChanged(bool hasFocus)
from IGazeFocusable interface. But this is only triggered when there is a change in the state of the object gaze. How can I check if the object is in focus whenever I want (like in the Update() of the object’s script).
Thanks in advance
Hi.
If you want to know if the object has gaze focus at any time, you can just store the hasFocus in a field every time its changed, like:
public void GazeFocusChanged(bool hasFocus)
{
_hasFocus = hasFocus;
}
void Update()
{
if(_hasFocus)……
}
Hope it helps.
/H