Unity-Technologies / EditorXR

Author XR in XR
Other
928 stars 166 forks source link

MeshTopology.Points / MeshTopology.Lines causes physics error #492

Closed obviousjim closed 5 years ago

obviousjim commented 6 years ago

If working with a gameObject that has MeshTopology other than triangles, the SetupCollisionTester fails with an error.

Here is the offending line

if (mf)
{
    collisionTester.sharedMesh = mf.sharedMesh;
    collisionTester.transform.localScale = Vector3.one;
    return;
}

A possible fix could be the following, but I'm not familiar enough with the intricacies of the system to know what the right fix could be.

if(mf && mf.sharedMesh.GetTopology(0) == MeshTopology.Triangles)
{
...
}