Get an Inflated Mesh Collider (vertices and faces)
What I have: A GameObject with a Mesh Renderer and a Mesh Collider. I have converted the Mesh Collider to a convex object and inflated a little bit with the Skin Width variable.
What I want: I want to export the vertices and faces of the inflated Mesh Collider (not the Mesh renderer).
More info.: I am using the tool "Scene OBJ Exporter" (https://www.assetstore.unity3d.com/en/#!/content/22250) and it only exports the Mesh Renderer, not the Mesh Collider. To solve this, I thought it is a good idea to convert the Mesh Renderer bounds to the Mesh Collider bounds and then export the resulting Mesh Renderer with the cited tool.
Tips: I think that the Bounds, Bounds.Encapsulate or Collider.SharedMesh functions could be usefull but I don't know how to use them. For example, the Collider.SharedMesh does not seem to return the inflated Collider Mesh.
Thank you in advance for your responses!
Answer by Bunny83 · Apr 28, 2017 at 08:43 AM
There is no built-in way to access the generated convex mesh. Unity made their convex mesh algorithm an internal function. Also there's currently no way to access the internally generated and used mesh from scripting. If you need a simplified convex mesh for your object, you have to create that yourself in your modelling application.