My ball bounces (rebounds) on the paddle without physics material

I am following a Unity course for beginners and I am stuck on one aspect of a bat and ball breakout type game.

We are covering colliders.

I have a ball that has a RidgidBody2D, a CircleCollider2D and ‘Is Trigger’ is not set. ‘Is Kinematic’ is not set. so the ball is a RidgidBody collider.

I have a paddle that has a RidgidBody2D, a Box Collider2D and ‘Is Trigger’ is not set. ‘Is Kinematic’ is set. so the paddle is a Kiematic RidgidBody collider.

Problem
When I add a a PhysicsMaterial2D with a Friction of 0 and a Bounciness of 1 the ball gets higher and higher with each bounce when it should be the same bounce each time.

Fault finding
I remove the physics material from the ball so I know this is not in the equation. When I step through the scene the ball and paddle are overlapping when they ‘colllide’. At that point the ball then reverses direction and moves away from the bat until the bat and paddle collision boxes (green) are touching then they come to rest. It looks like the ball is actually rebounding. Is this normal?

I have watched the tuition video over and over and even deleted everything and re done it a few times but I still have the same result. I am stumped.

Thanks for any advice that you can give.

Try setting the Rigidbody2D to “Continuous Collision” as well as setting the interpolation mode to “Interpolate” or “None”.

I think what you are seeing is the result of fast-moving objects using Discrete collisions. This means that if the objects are moving fast enough, they can be seen overlapping before the physics system adjusts their positions.

4 Likes

Thank you Jeffrey! I was looking for an answer for over an hour before coming across your post. Changing the Collision Detection from “Discrete” to “Continuous” fixed the problem for me.

1 Like