Get Array of All The Cells In A TileMapLayer

Godot Version

4.7.stable

Question

Back with another TileMapLayer question.

How do I get a list of all the cells (tiles) in a tilmaplayer via code?

Cause looking through the docs I didn’t see a simple function to do so. So I’m thinking I might just have to do a for loop for each coordinate, but that seems unnecessary. That’s why I’m looking for either an alternative, or confirmation that there is no alternative.

for cell in ‘tilemap’.get_used_cells():

Thanks. I guess I’m just not good at reading the docs. :sweat_smile:

It was in a recent tutorial I watched.