Checking tilemap layer inside a script

Godot Version

4.2.2

Question

I have a position Vector2 and I want to know whether on that position the tile is of layer “Walls” or some other layer. Is that even possible (because there can be multiple tiles of many layers at any given position)

Or do I really need to create multiple tilemaps to check whether a node tried to spawn inside of walls or not

You can use this function of tilemap:

get_cell_source_id ( int layer, Vector2i coords, bool use_proxies=false )

You not need to create multi tilemaps
There are many tutorials on YouTube like this

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.