Ball goes through the wall

I have made a rolling ball game by following the Unity tutorial. On top of that, I made a joystick that lets you control the ball in a smartphone. Now, I’ve also added the feature of the ball increasing in speed whenever it hits a yellow cube. The problem is that when the speed increases the ball goes through the wall… Does anyone know how to solve this?

If an object moves too fast it can move through a collider on one FixedUpdate call, so the collision is not detected.

You can try:

  • Decrease the value of Fixed Timestemp in Edit>Project Settings>Time. that will have performance cost.
  • Make the colliders bigger
  • Add upper limit to the speed of the ball
  • Verify via script if the ball is outside of the walls bounds

Have you tried to set the collision detection on the ball to ContinuousDynamic?