lifecycle.onCollision

Section: Lifecycle

What it does

onCollision is a lifecycle function: you write it in your script and the engine calls it. The engine calls it: physical collision. It receives other.

The API says: physical collision

Signature

onCollision(other)

Arguments

  • other

Example · generated

function onCollision(other) {  ui.setText('hud', 'hit ' + other);}

onCollision is not called, it is written. The engine calls it: physical collision. The body shown here is an example of what goes in it.

7 members in lifecycle