Why does the sphere collider pass through mesh collider at a certain point?

Hi there,

The question is as it stands but let me explain.I have a ball with a sphere collider and a platform with slants and turns with a mesh collider. Both have rigid bodies attached to them.

When you play, the ball rolls on the platform and stays on it which is the aim.However there is a certain point on the platform where the sphere just goes right through it and starts falling.

I have rebuilt the scene from scratch and created an empty game object with a collider attached that was just under the location where the ball seems to go through the floor,but non of this worked.And this has me confused as to how to fix it.All my other levels work fine and don’t have this issue except for this one.

So what I’m asking is what is the reason for the ball to pass through the platform(floor) only at a certain point in the level,but work correctly by staying on the platform across the rest of this level.

All advice is welcome :smiley:
By the way I have asked this on the forums,but have recieved no reply so far.

Ok, I’ll post this as an answer.
Check out these articles in Unity Documentation:

  • AddTorque adds an amount of force to rotate an object. Nice if the movement should be smooth and continuous, and “physics-like”.
  • MoveRotation sets the rotation directly but still calculates the physics correctly. Easy to use, allows sharp movements.

EDIT: All physics-related calculations should be inside FixedUpdate(), not Update(). FixedUpdate() @ Unity Docs

EDIT2: If the platform’s movement is directly controlled by the player, it should probably be a Kinematic Rigidbody. This means that physics won’t affect the kinematic object, but it will affect other rigidbodies.