I've got a ship thats a Rigidbody. The ship has a MeshCollider on it. This collider is set as Convex.
I've got the ground thats a programmatically created Mesh. That Mesh has aMeshCollider on it. This collider is not set as Convex.
Most of the time, this works. I don't fall through the floor. About 40% of the time I can drive through the walls.
Trying to solve this, for each wall section I added a child GameObject marked as static. This GameObject has a BoxCollider on it. I've sized the collider to be 0.1 larger than the section of the wall. This means the colliders overlap, and there should be no gap to fall through.
As you can see in the image below, I'm still able to drive through the wall some times.
What should I be doing so I can't drive through the walls?
I've tried:
Adding a
Rigidbodyto the ground as well, marked as kinematic. To do this I removed theMeshColliderall together and used allBoxColliders. I had to use allBoxColliders as you can have a Convex Rigidbody. This didn't solve the issue.I Removed the
MeshColliderfrom the player and use a singleBoxCollider. At this point there are no longer anyMeshColliders in the scene. This didn't solve the issue.Both
Rigidbodys are set to Continuous Collision Detection.
I'm staring to wonder if the UNity3d Physics system works at all :/
