So my mesh in unity has to many verts so its parted in 2 meshparts.
In my smaller meshes I got the mesh data like:
// Mesh data
private List<Vector3> _verts = new List<Vector3>();
private List<int> _triangles = new List<int>();
MeshFilter[] _filters = testRoom.GetComponentsInChildren<MeshFilter>();
foreach (MeshFilter _filter in _filters)
{
_verts.AddRange(_filter.mesh.vertices);
_triangles.AddRange(_filter.mesh.triangles);
testRoom.AddComponent<MeshCollider>();
testRoom.GetComponent<MeshCollider>().sharedMesh = _filter.mesh;
}
I would like the mesh collider to span the whole mesh and not just the parts eparately like what it does when I have generate colliders box checked, I cant use this since meshes might be generated at runtime.