Phaser API Documentation

  Version: 
setExistingBody(body, [addToWorld])

Description:

Set this Game Object to use the given existing Matter Body.

The body is first removed from the world before being added to this Game Object.

Parameters:

name type arguments Default description
body MatterJS.BodyType

The Body this Game Object should use.

addToWorld boolean <optional> true

Should the body be immediately added to the World?

Returns:
Description:

This Game Object.

Examples:
Since: 3.0.0