Phaser API Documentation

  Version: 
setOnCollide(callback)

Description:

The callback is sent a Phaser.Types.Physics.Matter.MatterCollisionData object.

This does not change the bodies collision category, group or filter. Those must be set in addition to the callback.

Parameters:

name type description
callback function

The callback to invoke when this body starts colliding with another.

Returns:
Description:

This Game Object.

Since: 3.22.0