Phaser API Documentation

remove(object, [deep])


Removes a Matter JS object, or array of objects, from the world.

The objects should be valid Matter JS entities, such as a Body, Composite or Constraint.

Triggers beforeRemove and afterRemove events.


name type arguments Default description
object object | Array.<object>

Can be single object, or an array, and can be a body, composite or constraint.

deep boolean <optional> false

Optionally search the objects children and recursively remove those as well.


This Matter World object.

Since: 3.0.0