Phaser API Documentation

setCollisionFromCollisionGroup([collides], [recalculateFaces])


Sets collision on the tiles within a layer by checking each tiles collision group data (typically defined in Tiled within the tileset collision editor). If any objects are found within a tiles collision group, the tile's colliding information will be set. The collides parameter controls if collision will be enabled (true) or disabled (false).


name type arguments Default description
collides boolean <optional> true

If true it will enable collision. If false it will clear collision.

recalculateFaces boolean <optional> true

Whether or not to recalculate the tile faces after the update.


This Tilemap Layer object.

Since: 3.50.0