It's a common system interaction to look at an item in SwiftUI and tap to select it.
I'm confused how to do the same with ModelEntities.
How do I use gaze to select a ModelEntity for context based actions? e.g. look at the green sphere and tap to pull up a menu. Or look in a direction and clap to **** away virtual objects etc. etc.
If this is not possible is there a workaround?
You can target SwiftUI gestures to RealityKit entities, which need to have both a CollisionComponent and an InputTargetComponent in order to enable this behavior.
This is also explained in the following 2023 WWDC talk:
- "Develop your first immersive app": https://developer.apple.com/videos/play/wwdc2023/10203/
You can also explore the developer samples here: