I am new to unity and I am working on a 2D game. Currently, I am having trouble getting two colliders to interact when one of them is a mesh collider and the other is a box or circle collider. I was originally working to get the Unity Sample Assets 2D character to interact with a mesh terrain. When I "played" the game, the circle collider attached to the legs of the character was falling through the mesh terrain. I have simplified the problem and created two cubes:
- One cube I upload and keep the 2d box collider and add a rigid body to
- The second cube I delete the 2d box collider and add a mesh collider
I place the second cube under the first cube and hit "play". The top cube falls through the bottom box. When I replace the bottom cube's mesh collider with a box collider and hit "play" it correctly collides and stops on the box. I'm guessing I'm making the same mistake in this simplified example as I am in the more complicated 2D Character scenario. Do you have any suggestions of what I am doing wrong? I have tried making the mesh collider convex (although I believe this should only be necessary between two mesh colliders?). I have also ensured that the z position is the same as well as the layers of the two objects.