- Home /
Question by
madfatcat · May 11, 2017 at 02:17 PM ·
collisioncolliderrigidbody2dphysics2dphysicsmaterial
2D Physics: Circle's velocity vector becomes parallel to collider's edge after collision with small angle
I'm trying to create a circle that will bounce continuously in closed room. I created a CircleCollider2D and Rigidbody2D for the circle, set gravity scale to 0, mass to 1, linear and angular drag to 0. For the walls I created BoxCollider2D and applied physics material with almost no friction (cannot be set to 0) and 1 bounciness to both circle and walls. The problem appears when the circle collides the box/edge with very small angle. In this case, after the collision circle's velocity vector becomes parallel to the edge circle collided with despite the bounciness is 1 for both edge and circle. I'd like to create a behavior when velocity angle after collision exactly equals 180 - angleBeforeCollision. How to achieve this?
Comment