- Home /
Breakdown non-convex complex Meshes to Convex parts
I have a ship mesh that I want to add a collider(or colliders) on it. What is the best way for me to break down into smaller parts? Where should I try to use primitive colliders, and where should I model parts of a mesh?
Here is my ship with "forced" convex mesh.
I'd do it in your 3D modeling application and use the resulting convex meshes for a compound collider (multiple mesh colliders on the same gameobject).
The thing is... If I separate the hull and try to make a mesh collider out of it, even thou, it won't be convex! Is there any option rather than make tiny parts and have like 50 colliders for my ship?
Imagine this: When making a collider for those stairs in the picture, either I do an approximation(make it more like a ramp) or I break every single step into a different mesh, and in the case of that stair, I will have 8 mesh colliders for one stair. Isn't there any workaround that?
No. If characters are supposed to walk on the ship, then detailed collision meshes are needed, as if it were a building or similar part of the world. If the ship is more like a unit in an RTS, a more simple collider is sufficient. Also, using ramp colliders for stairs is quite normal.
Answer by CMCmaster · Feb 15, 2017 at 07:36 AM
If the mesh is generated by code or has arbitrary geometry you could make a script which scans every edge of the mesh ; if it is concave cut along a plane defined by the end of the normal of the edge and the edge ; repeat for the resulting bodies and you have a lot of convex parts :) OR YOU COULD JUST DO IT MANUALLY BY ADDING MORE PREDEFINED COLLIDERS IF THE MESH IS NOT TOO COMPLEX TO DO IT BY HAND GOOD LUCK :)
Answer by Raresh · Feb 14, 2017 at 11:10 PM
https://www.assetstore.unity3d.com/en/#!/content/4596
You can try this asset, you will still need to do some mesh splitting to get really accurate results, but that will be a lot less work for you than doing it manually for components.
Your answer
Follow this Question
Related Questions
Player falls through Curved Mesh Colliders 1 Answer
Mesh Collider won't draw the mesh I am telling it to? 1 Answer
MeshCollider Collision Table 2 Answers
Implementing Meshless Deformation 0 Answers
Adaptive Mesh 1 Answer