Max X/Y value in TileMapLayer

Godot Version

4.3

Question

How can I find the highest Y and X value using the new TileMapLayers? Using the old TileMaps You could do this below and get both the furthest X and Y values from (0,0). In Godot 4.3, only the X value still works.

Screenshot 2024-08-20 203918
Screenshot 2024-08-20 203728

Visually, the old get_used_cells() method would end with it’s last cell being the bottom layer of the map which is (…, 49). Now, get_used_cells() finishes running at the middle chunk of the map with the last cell being (20, 40). With the reordered Array[Vector2i], how should I get the max Y value? Thanks so much for your time.

You can iterate through the used_cells and check yourself for the highest/lowest values

1 Like

Yes, that is correct. I am lazy and was hoping there was an easy way :frowning:. Thanks for you help!

Solution:
Screenshot 2024-08-21 153213

I dont know if theres a method for this but if theres is its probably using the same logic

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