I currently have a 2D scene in which a tank, the player, moves around. A rigidbody component with a 2D box collider is attached to it. On the edges of the map I have tiles that are kinematic rigidbodies with a 2D box collider as well. I use Rigidbody.LinearVelocity to move the tank.
When I move the tank into an edge tile it slows down and moves noticeably into the tile before bouncing back. Restitution is 0 for all the rigidbodies involved. Is there any way to have a pixel-perfect collision where the tank stops immediately?
Before (Moved the tank next to the wall)
During (Moving the tank into the wall
After releasing the forward key the tank returns to its former position.
Thank you.
EDIT: After reading a few websites I found out that most game engines don’t natively support pixel-perfect collisions. This website: https://www.gamedev.net/articles/programming/general-and-gameplay-programming/intelligent-2d-collision-and-pixel-perfect-precision-r3311/ shows how to implement it.