Detecting Gaze/Look on Entity in RealityKit on visionOS

Is there any way to detect if an entity is being looked at in a RealityView. I know it is possible to add a "HoverEffectComponent()" which will highlight the entity a little when you gaze on it, but there doesn't seem to be any way to call a function from this. There is also no GazeGesture or anything similar.

On visionOS, where you look stays private. So your app can specify how RealityKit entities will behave visually on hover (for example, with HoverEffectComponent) but your app can not be notified when a hover event occurs (e.g. a callback function) for privacy reasons.

That being said, in visionOS 2 we have introduced new ways to customize hover behavior with RealityKit's HoverEffectComponent and SwiftUI:

Is it correct to say then that if I want to select, say a control, by looking at it -- that is some ModelEntity or Entity that I've created in my scene that I cannot do so?

If we wanted to use some kind of ModelEntity as a control we would have to use some other gesture like a pinch, or raycast?

Detecting Gaze/Look on Entity in RealityKit on visionOS
 
 
Q