How to detect if i'm looking a button?

Hello everyone.

I am working with AVP and I am trying to create an animation that increases the size of a button when you are selecting it with your gaze. I am here to ask if there is any component to add and detect that it is being selected with the gaze, or some lines of code to perform this detection and carry out the animation.
Thank you very much for your time and best regards.

By design, Apple doesn’t expose gaze information in a way that is accessible on the CPU. However, the visionOS 2.0 beta provides a way to access hover information in shader graphs. if you use the latest PolySpatial 2.0.0-pre.9 packages (which require visionOS 2.0 beta 4 and Unity 6000), you can use the PolySpatial Hover State node in a custom shader on your UI component to modify/animate the size of the button image based on whether the button is being looked at.

1 Like