- Home /
BoundsInt.allPositionsWithin is not working?
I have a BoundsInt with Position: (0, 0, 0), Size: (32, 18, 0). Then I looping through the allPositionsWithin property and logging it to the screen. But it wasn't working. So I print the allPositionsWithin.Current and MoveNext(): Position: (-1, 0, 0), false. How the current position is (-1, 0, 0) when the boundsint position is (0, 0, 0) and why MoveNext() is false?
Comment
Best Answer
Answer by ivanngoc · Dec 30, 2020 at 11:45 PM
Аfter you called Tilemap.ResizeBounds() or created BoundsInt with new() you can call bounds.ClampToBounds(bounds); foreach will work after that. I Don't know how much it expensive or why it's like that...but it's working that way