Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Enquest |
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 .get_used_rect() that would be perfect… If only it would give the tile that the rigedbody hits. I would need something like tilemap.get_colllising_rect() so I can set the cell -1.
If using kinematic body then there are more easy solutions for this. Why not with rigidbody?