Phaser API Documentation

  Version: 
disableBody(body)

Description:

Disables an existing Arcade Physics Body or StaticBody and removes it from the simulation.

The body is disabled and removed from the local search trees.

The body itself is not deleted, it just has its enable property set to false, which means you can re-enable it again at any point by passing it to enable World.enable or World.add.

Parameters:

name type description
body Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The Body to be disabled.

Since: 3.0.0