How get size of tilemap?

I need to get width and height of the tilemap, how do it?
Thanks!

thanks, but Is there a way to get size in pixels (or similar units)?

Not directly, but it’s easy enough to calculate since you know the size of each tile.

is there clean way to get size of tile, i want reuse my script ?

No, but you can add a property to your script and set it for each instance.

2 Likes

ok, thanks for the help

I would prefer to get tile size from tilemap - it seems safer. If you ever change the tile size you have to also change property which is no big deal, but still another layer of mistakes . And knowing that tilemap already provides it’s size in number of tiles, giving a size of tile map (or a tile size itself) in pixels seems convenient. What do you think?

1 Like