Skip to main content
1 of 3
Jay
  • 287
  • 4
  • 15

Unity Is there a way to get the actual optimised/cooked mesh that a mesh collider uses

I need to get the number of vertices a mesh collider's mesh has, I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to. But this is not the mesh actually used by the object, as cooking -> cook for faster simulation can drastically alter this mesh.

Is there a way to get the actual cooked mesh? I only need to read it, not alter it.

Jay
  • 287
  • 4
  • 15