Triggers
Colliders can be set as triggers, this allows them to detect collisions without being affected by them.
This example shows a box collider that is set as a trigger and a falling box.
When the falling box collides with the trigger, a message will be logged to the console.
this.world!.config.collisionClasses.push({ name: 'Trigger' });
{ mass: 0, isTrigger: true },
);
this.events.addListener(
'Trigger',
if (event.payload.entityA === box) {
console.log('Collision started', event);
}
},
);