- Home /
How do I split a mesh to piece and apply a mesh collider to each piece in the scene?
set the Mesh Colliders to the Convex and attach one Rigidbody. And use it as a collision object. Is it possible? I wonder how to implement it if possible. Or is there a site that can help?
Here's a script that does what you want, plus an explosion force.
http://answers.unity3d.com/questions/256558/Convert-mesh-to-triangles-js.html
Thanks! It's a nice script. But it seems to be misrepresenting my intentions. In edit mode, divide one mesh into several. Then attach a $$anonymous$$esh Collider to each mesh. If attach one Convex $$anonymous$$esh Collider, collision will be inaccurate, so subdivide the $$anonymous$$esh and attach the several Convex $$anonymous$$esh Collider. In short, select a specific part of the mesh in edit mode and attach a $$anonymous$$esh Collider only to that part.
A convex mesh collider is only needed on moving rigidbodies. Static geometry doesn't need to be convex.
Also note that a convex mesh collider actually calculates the convex hull of the original mesh. The mesh need to have "volume". A flat mesh (where all vertices are on the same plane) will cause an error when unity tries to calculate the convex hull.
You should be more specific in your question. What is this collider used for? Why do you think it need to be convex?
You only attach a rigidbody to an object if that object is meant to move on its own. Static geometry shouldn't be a rigidbody and doesn't need to be convex