So I want to check how many tiles named “coin” I have in my map.
This is my attempt:
local i = 0
for tile in map.layer[“tileobjects”].tilesInRect(map.width*0.5,map.height*0.5,map.width,map.height) do
if tile.name and tile.name == “coin” then
i = i+1
print("coins in map: ",i)
Loop took ~1 minute and I got 0 in result when there were supposed to be 9 coins…
So is there other method to do this?