Search code examples
c#unity-game-enginegame-physicsvelocityrigid-bodies

Car flips over in Unity at the border of two colliders


I have made a little racing game in Unity. I created a track out of a few different parts and all of them have a mesh collider. Now when I'm driving over the border of two segments the car flips over like in the image: Car flipping

Here are my rigidbody settings: Cars rigidbody

This also happens, when I'm driving at a wall at an angle. Thanks for any help.


Solution

  • The colliders in unity are a bit buggy, even when perfectly aligned, an edge can catch.

    The best way to combat this is to use only one collider for the ground plane.

    This way, there are no seams and nowhere to catch on the car. This can be accomplished by removing all the existing colliders and creating a single game object with a collider and then aligning the top of the collider with the track manually or programatically.