Does an empty CollisionFilter prevent RealityKit input on macOS and iOS?

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?

Answered by DTS Engineer in 908642022

Thanks for the clear comparison across platforms, and for testing CollisionFilter.default as a control.

I see the same behavior on iOS 27.0 (iPhone 18 Pro Max) and macOS 27.0.1. I gave four entities an InputTargetComponent and a .trigger CollisionComponent, and varied only the filter:

On both platforms, only the entity with CollisionFilter.default received taps. That was true for a GestureComponent with a TapGesture on each entity, and for a SpatialTapGesture on the RealityView with targetedToAnyEntity().

The InputTargetComponent documentation presents the empty filter as a way to receive input without physics processing. Please file a Feedback Assistant report describing what you see on each platform. Then post the Feedback number here so we can make sure it gets routed to the right team. If you're not familiar with filing reports, take a look at Bug Reporting: How and Why?

The trigger documentation addresses the physics side: for a trigger object, "RealityKit records that contact was made, but does not compute other details," and "Triggers are not simulated." The CollisionFilter.default documentation says, "Entities with a default collision filter have a group of default and a mask of all."

Thanks for the clear comparison across platforms, and for testing CollisionFilter.default as a control.

I see the same behavior on iOS 27.0 (iPhone 18 Pro Max) and macOS 27.0.1. I gave four entities an InputTargetComponent and a .trigger CollisionComponent, and varied only the filter:

On both platforms, only the entity with CollisionFilter.default received taps. That was true for a GestureComponent with a TapGesture on each entity, and for a SpatialTapGesture on the RealityView with targetedToAnyEntity().

The InputTargetComponent documentation presents the empty filter as a way to receive input without physics processing. Please file a Feedback Assistant report describing what you see on each platform. Then post the Feedback number here so we can make sure it gets routed to the right team. If you're not familiar with filing reports, take a look at Bug Reporting: How and Why?

The trigger documentation addresses the physics side: for a trigger object, "RealityKit records that contact was made, but does not compute other details," and "Triggers are not simulated." The CollisionFilter.default documentation says, "Entities with a default collision filter have a group of default and a mask of all."

Thanks for confirming. I’ve filed this in Feedback Assistant as FB25114901: “RealityKit: empty CollisionFilter prevents input on macOS and iOS.”