How to get direct access to scene in TileMapLayer?

Godot Version

v4.5.1.stable.arch_linux

Question

I need to get signal of scene inside TileMapLayer, and there is multiple scene copies within that tilemap that have only alternative ID as the difference. I need access only to one with ID 1. Question: how? I just can’t find the solution. Also I need to copies access their alternative ID for them to act differently depending on it.

1 Like

Afaik, direct mapping from a cell to the scene instance in not exposed to scripting.

You can do it bruteforce. Iterate through all instances, get their position and use that position to identify the corresponding cell.

1 Like

Ok, thank you. To bad that I cannot have a direct access to tilemap children by id, but I guess for loop will not harm my code

1 Like