ARTICLE AD BOX
I’m working with RealityKit and trying to detect on which side of a connector a sphere has collided.
The setup:
I have a connector (a cylinder). It has two child entities, each one with its own collision shape:leftCorner and rightCorner.
(They are not ModelEntities, only Entities with collision components.) Each entity has its own component and its own CollisionFilter. The goal: Detect whether the sphere touches the left or right side Prevent the main cylinder from colliding with the sphere
However, when the leftCorner collides with the sphere, RealityKit also reports a collision for the rightCorner, even though they use different collision groups and masks.
let leftFilter = CollisionFilter(group: .leftCorner, mask: .molecule) let rightFilter = CollisionFilter(group: .rightCorner, mask: .molecule) let cylinderFilter = CollisionFilter(group: .theMain, mask: .gesture) let sphereFilter = CollisionFilter(group: .molecule, mask: [.leftCorner, .rightCorner])Expected behavior:
sphere ↔ leftCorner (allowed) sphere ↔ rightCorner (allowed) leftCorner ↛ rightCorner (not allowed) sphere ↛ cylinder (not allowed)Actual issue:
When the sphere touches the leftCorner, the rightCorner also receives a collision event.
Sometimes the parent cylinder also fires even though its mask excludes the sphere.
Question:
What is the correct way to configure groups and masks so that only the intended corner entity collides with the sphere, and the other corner (and the parent cylinder) do not register collisions?

