Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Amel Ismail |
I want to have it so that when the player moves into a certain position, specific tiles are removed to reveal a pathway.
I’ve heard about set_cell() but I’m not sure how to implement it into my code.
I tried:
if position = Vector2(20, 10):
Tilemap.set_cell(26, 10 -1)
But it doesn’t seem to work
I’m obviously new to Godot and would appreciate any help to teach me how to use set_cell()
Tilemap.set_cell(26, 10 -1)
is setting a cell to -1
, which is actually equal to TileMap.INVALID_CELL
. So your code should work, it is effectively removing the tile at (26, 10), allowing to see whatever is behind (assuming you did put something behind?)
Zylann | 2020-03-10 02:04