Tilemap rect larger than object

I’m pretty new and I’m sure I’m not using the right word for this, but you can really notice the problem when I select the Rect tool, so that’s what I’m going with.

When creating a tilemap, the rect becomes much larger than the object itself. How can I get it to just border the edges of what I drew? It really messes up positioning when trying to instantiate objects.

Instead of deleting the whole tilemap, you could just simply compress it. Than it will shrink to the size of the filled tiles.

To compress a tilemap: Tilemap GameObject → Tilemap Component → Three dots on the right → Compress Tilemap Bounds.


I’m having the same problem. The rect just wouldn’t shrink after removing tiles and due to that, the tilemap.size and tilemap.origin would show weird coordinates. At the end I ended up creating a new tilemap with the desired size and deleted the old one. Now still when I create a new tilemap and put some tiles in, after removing them, the rect still doesn’t shrink. I feel like there is some issue with Unity.

Exactly the same issue here…