HavokPlugin setCollisionCallbackEnabled failed

I have 2 balls and a floor. I don’t want to get the collision callback of the ball and the floor. I write the code like this, but I still get the callback. Are these two mutually exclusive?

const sphere = new PhysicsAggregate(instance, BABYLON.PhysicsShapeType.BOX, baseImpostorParams, scene);
sphere.body.setCollisionCallbackEnabled(true);
sphere.body.setEventMask(hk._hknp.EventType.COLLISION_STARTED.value)

const ground = new PhysicsAggregate(instance, BABYLON.PhysicsShapeType.BOX, baseImpostorParams, scene);
ground.body.setCollisionCallbackEnabled(false)

const observable = hk.onCollisionObservable
const observer = observable.add((collisionEvent) => {
  console.log(collisionEvent.collidedAgainst.transformNode.name,collisionEvent.collider.transformNode.name,)
      })

Hello and welcome to the community!
If you enable the callback for one body, there’s going to be collision events for anything involving it, no matter the status of the other body.

1 Like

OK, but I read on the official website “world-wide callback” is more performant than “body-specific callback”,Dealing with useless colliders is not so elegant,If I have hundreds or thousands of colliders