I’m not sure how I’m supposed to make good use of the CompressBounds() function when it doesn’t update until I manually make a change to the tilemap. What’s up with this? I call CompressBounds(), but it won’t do anything to the bounds until I make any change at all to it, e.g. having the tile palette window out and putting my mouse over the tilemap (which changes the bounds itself). Is there a way to refresh everything without putting my mouse over it?
the function is useful during runtime it updates correctly
I might be encountering a bug or something then, I’m not sure what I’m doing wrong. Doing CompressBounds() only does so on time the first time I call it. The next times I call it, the bounds don’t update until I move my mouse onto the scene again. Sometimes it doesn’t properly bounds at all, not even the first time. I’m using Unity 2019.4.2f1 (LTS).
try using debug.log to check your bounds size before and after you call compress
you shouldnt need to navigate the scene view to check it
Alright so here was the misunderstanding. It turns out Tilemap and Tilemap Renderer have two different bounds. I was trying to use the Tilemap Renderer’s bounds thinking it would be the exact same. When you create a Box Collider, it defaults to matching the size of the Tilemap Renderer bounds rather than the bounds of the Tilemap itself.