Phaser API Documentation

  Version: 
setCollisionFromCollisionGroup([collides], [recalculateFaces])

Description:

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).

Parameters:

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.

Returns:
Description:

This Tilemap Layer object.

Since: 3.50.0