Can someone explain “Direct” gestures and point me at the dev docs for then?

I feel like I’m going nuts.

I understand the concept of direct versus indirect gestures. I can make entities with targeted indirect gestures all day long. Piece of cake.

All I want to do is figure out how to add a DIRECT gesture to an entity so that I can detect a user touch on an object. Apples docs provide a nice video of knocking over cubes and what direct gestures typically do, but I can find zero gesture documentation that actually speaks to implementation?!???

Just hoping someone out there can point idiot me at a sample, class, anything, that says “here’s how to implement a direct gesture in visionOS”?

Thanks much!

Hey @BLite , you can add direct gesture like this:

entity.components.set(InputTargetComponent(allowedInputTypes: .all))

or:

entity.components.set(InputTargetComponent(allowedInputTypes: [.direct, .indirect]))

The options for allowed input types are: .direct, .indirect, .all as shown here under "type properties" https://developer.apple.com/documentation/realitykit/inputtargetcomponent/inputtype

input target component docs: https://developer.apple.com/documentation/realitykit/inputtargetcomponent

Thank you so much!

Can someone explain “Direct” gestures and point me at the dev docs for then?
 
 
Q