#How to detect if a tile has collision?

2 messages · Page 1 of 1 (latest)

bronze knot
#

For some kind of building mechanism (placing blocks) I want to check via code if a specific tile has collision or not, to know if I can build there or not.

But I can‘t figure out how to check if a tile in a tilemap contains collision.

hollow ember
#

Tilemapnode.get_cell_tile_data(layer: int, coords: Vector2i).get_collision_polygons_count(layer_id: int) -> int

Note that the ending layer_id is not tilemap layers but tileset collision layers, as configured in the tileset. If the result of this command is 0, the tile has no collision on the specified layer.