Apple's InputTargetComponent documentation shows this code for an entity that should receive input without participating in physics:
// Create a collision component with an empty group and mask.
var collision = CollisionComponent(shapes: [.generateSphere(radius: 0.1)])
collision.filter = CollisionFilter(group: [], mask: [])
myEntity.components.set(collision)
In my RealityKit scene, myEntity also has an enabled InputTargetComponent and a GestureComponent with a TapGesture callback. I use .trigger collision mode. With the empty group and mask, the callback runs on visionOS but does not run on macOS or iOS. Changing the filter to CollisionFilter.default makes the callback run on macOS and iOS. The entity and gesture setup are otherwise the same.
Should the documented empty filter still allow input hit testing on macOS and iOS? Is this a RealityKit bug, or does input targeting on those platforms require a different collision filter or additional setup?
Topic:
Graphics & Games
SubTopic:
RealityKit
0
0
12