Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | MemokingMH |
I have a tilemap that has collision in it. I want to control the collision of it from script. Is this possible?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | MemokingMH |
I have a tilemap that has collision in it. I want to control the collision of it from script. Is this possible?
Reply From: | timothybrentwood |
There are the set_collision_layer_bit(bit: int, value: bool)
and the set_collision_mask_bit(bit: int, value: bool)
to adjust the overall collision at runtime. There are a couple more in the docs here: TileMap — Godot Engine (stable) documentation in English
If you are wanting to set the change the collision of an individual cell at run time you can use set_cell()
to change the tile to a different tile that doesn’t have collision.