How do I make my mesh collider more accurate?

Hi there,

I have a 3D mesh collider that doesn’t seem to work properly. I’m using a height-mapped terrain as the mesh and my character bumps into it, as expected, but sometimes just passes straight through.

The mesh is pretty substantial (the original plain was 200x200), so I don’t think it’s a polygon accuracy thing… is using a collider this big just too much for the system? Should I perhaps break it up into primitives, even though I’d need a LOT of them?

Any help greatly appreciated :wink:

Do you really need that much detail? Are you just colliding with ground? Or is your object very convoluted, and needing to avoid many detailed collidable objects in the scene?

–

Hi Dave, the problem is, the world is actually on a 2D plane... a la SNES MODE7 (a detailed image textured to a plane), but I need a mesh for the collision, so I have made one from a heightmap of the flat terrain. I COULD do it with primitives but it would need a lot of them... the mesh just doesn't seem to want to play ball. I should add, I'm only using it for wall collisions, not ground.

–

1 Answer

1

You might be facing a SPEED issue, rather than a mere collision one.
Check out
http://unity3d.com/support/documentation/Components/class-PhysicsManager.html
and tweak the penetration for penalty, since at high speeds you need less penalty.

And possibly check out
http://unity3d.com/support/documentation/Components/class-TimeManager.html
too. Since you might need more physics frames per second at very high speeds.

Ah, cool, thanks! I'll check those out... learning more stuff every day ;-)

–