API

Interface CharacterCollisionEvent

Collision event fired by PhysicsCharacterController.onTriggerCollisionObservable for every dynamic body the character pushes during a step. Mirrors Babylon.js' onTriggerCollisionObservable payload, including the thin-instance collider index.

interface CharacterCollisionEvent {
    collider: PhysicsBody;
    colliderIndex: number;
    impulse: Vec3;
    impulsePosition: Vec3;
}
Index
collider: PhysicsBody

The dynamic physics body the character contacted. Its .node.name identifies the collider.

colliderIndex: number

Thin-instance index of the collider; 0 for an ordinary body.

impulse: Vec3

Impulse (world space) the character applied to the collider at the contact point.

impulsePosition: Vec3

World-space position of the contact at which the impulse was applied.