title: Create a single MeshCollider for mesh with many vertices
body: <p>I am doing some calculation with meshes in unity and adding <code>MeshCollider</code>'s to calculate pathfinding. Some meshes that are generated are very big and splits meshes into 2 or more 'mesh parts'. I set MeshCollider like so: </p>
  
  <pre><code>testRoom = GameObject.Find("testroom");
  MeshFilter[] _filters = testRoom.GetComponentsInChildren&lt;MeshFilter&gt;();
  foreach (MeshFilter _filter in _filters)
  {
     _verts.AddRange(_filter.mesh.vertices);
     _triangles.AddRange(_filter.mesh.triangles);
  
     testRoom.AddComponent&lt;MeshCollider&gt;();
     testRoom.GetComponent&lt;MeshCollider&gt;().sharedMesh = _filter.mesh;
  }
  </code></pre>
  
  <p>This obviously dont work with several meshparts since the Collider gets overwritten. Since the mesh is to big I cannot merge the meshes together and set a collider, right? When I use the Generate Colliders box in unity it works fine but I want a programmable solution since I am to generate the meshes at runtime. </p>
  
  <p>Does anyone know how to make a single collider for the big mesh that is split into several parts due to having to many vertices?  </p>
  
  <p>Here is a picture of the mesh (as requested) It might look abit strange but it's (part of) an office building. I made the mesh myself using a Tango tablet. I diddnt include a tango tag because I did not think how the mesh looked would affect the answer.  </p>
  
  <p><a href="https://i.stack.imgur.com/b7xyo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b7xyo.png" alt="enter image description here"></a></p>