TileMapLayer.set_cell function set source_id to -1

Godot Version

4.5

Question

I trying to make the wall change if attacked, but when i try to set the ID of the cell it becomes -1 and the cell disappears. I’m a beginner, English isn’t my first language, and Idk where I shoud start to solve this. Help.

Debug here:

image

I got that 10 minutes after sending this. Just a silly misunderstanding. My bad. Unfortunately I didn’t find an option to delete pending posts, Lol.

I just added one more argument specifying the position in the atlas and everything worked fine. Without any arguments it defaults to -1! I can’t believe I spent so much time on this.

2 Likes