Objects going partway through each other

Hello everyone. I’ve exported some building block shapes from Max and in Unity I’ve tried box and mesh colliders on the objects but they pass partway through each other when they collide, the collision is happening at the center of the mesh rather than the outside. The collider surrounds the mesh. A screenshot of what I mean can be found here.

https://dl.dropbox.com/u/33377838/screenshot.jpg

Well I can say that if they’re using mesh colliders and you have a rigid body component attached to them they will go through each other if “convex” is not checked in the mesh collider properties. But if you’re using box colliders they should work as long as the boxes are set up right. Try recalculating normals maybe if none of that works.

I was having this same issue making a 2D game. So if anyone is having this problem in 2D, I’ve found one solution:

Go to Edit >> Project Settings >> Physics 2D >> Then change the “Position Iterations” from 3 to about 8. This ups the iterations that check the positions of things, like your player’s movement.

I was moving my main player with rigidbody.transform.Translate((Vector3.right * moveThrust) * Time.deltaTime, Space.World); and my player would go halfway into walls as I moved him around. But upping the Position Iterations fixed that problem.

The downside to this, is that it makes your program more costly memory-wise. So it may not be the best way to fix the issue, but I couldn’t find any other solution…