A rigidbody hits a tilemap. How do you know what tile was hit so you can set its cell to -1
The position of the rigidbody is not the position of the tile. That has an offset. I could start doing some calculations, size of rigidbody + velocity length etc to know what tile it hit. But that seems not the way to go.
There is a function on the tilemap .getusedrect() that would be perfect... If only it would give the tile that the rigedbody hits. I would need something like tilemap.getcolllisingrect() so I can set the cell -1.
If using kinematic body then there are more easy solutions for this. Why not with rigidbody?