0 votes

I have a tilemap that has collision in it. I want to control the collision of it from script. Is this possible?

Godot version 3.2
in Engine by (44 points)

1 Answer

0 votes

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: https://docs.godotengine.org/en/stable/classes/class_tilemap.html#class-tilemap-property-collision-bounce

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.

by (2,832 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.