I have a script that creates a MeshCollider from the mesh I have, by removing any triangles which have an normal angle with World Up larger than a threshold.
So far, this is working correctly, the problem comes in when I set my pieces of geometry to be static. After I do that, the generated MeshCollider is displaced by a certain amount, and my character, predictably, doesn't collide with the platform.
Is there something I should calculate differently when dealing with static objects? There seems to be an offset that is being used for my geometry, which I have not set up.
Any help will be appreciated, thanks!
Red debug draw represents the generated MeshCollider
The geometry has the static flag on.
The geometry has the static flag off.
There's probably an issue with the actual meshes being changed when turned into static. Perhaps you can make them static after you have generated the colliders. http://docs.unity3d.com/Documentation/ScriptReference/StaticBatchingUtility.html
answered Aug 03 '12 at 11:45 PM