Skip to content

Commit 1982e3c

Browse files
committed
Fixed bug
1 parent 29a9556 commit 1982e3c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Assets/FbxExporters/Editor/ConvertToModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,13 @@ public static void CopyComponents(GameObject to, GameObject from){
439439
toRenderer.sharedMaterials = fromRenderer.sharedMaterials;
440440
}
441441
}
442+
// Point the mesh included in the mesh collider to the mesh in the FBX file, which is the same as the one in mesh filter
443+
if (to.GetComponent<MeshCollider> () != null && from.GetComponent<MeshFilter> () != null)
444+
{
445+
var toMeshCollider = to.GetComponent<MeshCollider> ();
446+
var fromFilter = from.GetComponent<MeshFilter> ();
447+
toMeshCollider.sharedMesh = fromFilter.sharedMesh;
448+
}
442449
}
443450
}
444451
}

0 commit comments

Comments
 (0)