is there an overhead to using mesh colliders? mine are mostly just static objects (so no collision detections at all) with a few (very low polly) being used to check collisions.
is it more efficient to try where possible to put box colliders in there?
I use a simplified collision mesh with a mesh collider for more complex objects. I don’t have any data to prove it, but my logic tells me that this is the way to go. So I have a 500 poly mesh + a 100 poly mesh for collision VS. one 500 poly mesh for both. Any thoughts, anyone?
I’m just guessing here but if you use primitives grouped together you may be able to get the 100 polys down a little more - depends on the shape and size of course.
In the docs this is a recommended procedure over and above using a mesh collider, from what I remember, I guess primitives are just less costly cpu wise?
Just out of curiosity: If I make my own box-mesh (12 triangles) and use that as a mesh-collider - is this more costly than using a standard box collider or is it the same?
I don’t know to be honest - you need some proper seasoned techie who knows Unity much better than I. If we knew how the mesh collider worked or why it was slower then we could make an educated guess. Cubes have 12 triangles dont they so it wouldnt take many to go above 100.
it’s going to be more costly.
calculating physics for simple shapes such as spheres, capsules and boxes can be done very fast. Meshes can have arbitrary shapes, and the math involved to calculate physics for them is a lot more expensive.
Concave meshes are even worse than non concave meshes.
The good part is that you can combine several boxcolliders into one rigidbody. I rarely come across a case where using a collection of simple shapes is not good enough to use for physics, and an actual mesh is required.
Bye, Lucas
PS: This is where Unity’s physics implementation rocks Director’s implementation by miles. They both have physx, but director will not let you make a rigidbody consisting of multiple shapes. So in Director you’re often forced to use the expensive mesh colliders, where in fact three box colliders would have done the job as well. Not to mention it’s many times easier to actually setup your physics scene in unity. In director it has to be done all trough code.
As said always see if your collision can be handled by a collection of primitive colliders in stead of a mesh and for those extra cycles, stick to spheres when possible.