Home Forums EyeX Software Development dev Unity UI Gaze Aware Button

This topic contains 6 replies, has 4 voices, and was last updated by Profile photo of Alex [Tobii] Alex [Tobii] 3 weeks, 1 day ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6413
    Profile photo of Calum Timpany
    Calum Timpany
    Participant

    I’m wondering if there is any way to set up a button in Unity to be gaze aware. Essentially what i’m trying to do is to be able to interact with a button using gaze like you would with a mouse (i.e. look at the button, and then click to have it perform whatever action it is set to do).

    From looking at other forum posts it looks like this was possible to do in the past, but i’m assuming after Unity change how UI works that this changed.

    I’m relatively new to using the Unity SDK, only having started using it this year as part of a University project, so apologies if there is a very straightforward way of doing this that I’ve managed to miss.

    If it is still possible to make a gaze aware button then I would appreciate if someone could explain how to to this. If it is not possible it would be useful if someone could explain why this is the case, as this would be something I could include in my final report.

    #6527
    Profile photo of Alex [Tobii]
    Alex [Tobii]
    Participant

    Hi!

    Currently we support gaze aware components only for 3d objects. But you can definitely compare gaze coordinates with ui element bounds to make it gaze aware.

    Please make sure to use some filtering/stickiness and add margins to you UI button bounds. It’s also probably not the best use case for eye tracking if we are talking about game features.

    #7220
    Profile photo of jay
    jay
    Participant

    so there is not a simple solution for interacting with ui elements?

    #7223
    Profile photo of Alex [Tobii]
    Alex [Tobii]
    Participant

    Not as easy as drag n’ drop component at the moment. But it’s on our backlog.

    As I mentioned before, you can just check if gaze point is within the bounds, or use 3D gaze aware objects.

    #7224
    Profile photo of Chris Hoopes
    Chris Hoopes
    Participant

    I actually just implemented this the other day. Easiest way to do it is get the coordinates of the gaze point and use Unity’s UI Graphic Raycaster to figure out what elements they’re looking at and then act on them.

    https://docs.unity3d.com/ScriptReference/UI.Graphic.Raycast.html

    #7227
    Profile photo of jay
    jay
    Participant

    thanks. I was able to accomplish what I wanted to do with Clean UI.

    #7228
    Profile photo of Alex [Tobii]
    Alex [Tobii]
    Participant

    If you do raycasts for UI, it’s important to use some scoring to reduce flickering.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.