Ball ignores paddle and walls

Hi all,

I am having issues with the behavior of the ball in the play scene.
When the ball has a perfect vertical or horizontal bouncing and the velocity increases, it ignores the paddle and the walls and it goes out from the play scene.
Does anyone know if this is an expected behavior?

Below, you can find the attachments.

Thanks!

Can You Please Share Your Scripts And Some SS Of Your Editor
The GamePlay Images Cannot Tell Much About The Error

Hi Penelope,

Have you already tried to set the Collision Detection of the ball’s Rigidbody2D component to “Continuous”? If you have a Physics2D material assigned to the ball, try to remove it.

If the issue persists, could you please share screenshots of what you see and did in Unity?

Hi Nina and ADITYA_SAHU,

Thanks for replying.

Currently, the ball object has the following configuration:

and the material configuration is:

boucing

I set a bounciness to 1.2 to increase the velocity of the ball. It starts to ignore the other colliders when the its velocity is higher. I also tried with 1.5 and the ball was too fast that goes out of the scene at the beginning.

Not sure if this behavior was defined in Unity to avoid problems.

1.2 bounciness means 1.2 times more energy when a collision happens. In theory. Unfortunately, one cannot rely on expectations. For this reason, I suggested to remove the Physics2D material from the ball. You don’t have to delete it in your Assets folder. Just remove it from the ball and test your game again.

Thanks Nina!

I set the bounciness to 1 and the ball does not ignore the colliders.
In order to understand the issue, the ball’s energy is not constant when the bounciness is greater than 1, so at some point the energy is too high and the ball ignores the other colliders.
Is it possible that the ball’s body type change from dynamic to kinematic?
That could explain why the ball ignores the colliders, but not sure.

Thanks for your help!

That was not happening here, I think. The ball accelerated whenever it collided with something. Since Unity cannot handle fast moving objects well, the ball ignored colliders at some point.

Unfortunately, the physics simulation is not reliable, which is the reason why I’m not a big fan of the Physics2D material. You sometimes get a strange behaviour even if you set the bounciness to 1. In theory, 1 is supposed to preserve the current energy. Maybe that changed in newer versions of Unity but in the past, the ball happened to lose energy even with 1.

So if you are experiencing strang side effects, the issue is not necessarily caused by you but by the Physics2D material.

Is the issue solved?


See also:

Yeah, now it is more clear.

Thanks for your help Nina!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms