Saltar al contenido principal

Physics Events

Events

COLLISION_START_EVENT

Emitted when the entity has started colliding with another entity.

Properties

PropertyTypeDescription
othereidThe eid of the colliding entity

Example

world.events.addListener(component.eid, ecs.physics.COLLISION_START_EVENT, (event) => {
console.log(event.data.other)
})

COLLISION_END_EVENT

Emitted when the entity has stopped colliding with another entity.

Properties

PropertyTypeDescription
othereidThe eid of the colliding entity

Example

world.events.addListener(component.eid, ecs.physics.COLLISION_END_EVENT, (event) => {
console.log(event.data.other)
})