Skip to content

Commit 2b54c8f

Browse files
authored
Merge pull request #381 from Unity-Technologies/bugfix/fixing-mesh-collider-error-with-unity21.2
Bugfix/fixing mesh collider error with unity21.2
2 parents 55eaae6 + bf1cfd9 commit 2b54c8f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Bug Fixes
1111

12+
- [case: 1323666] Preventing to assign an empty mesh as MeshCollider.
1213
- [case: 1322032] Fixing wrong ProBuilderMesh colors on domain reload when null.
1314
- [case: 1322150] Fixing torus and sphere UV generation when creating New Shape.
1415
- [case: 1320936] Fixing 'ProBuilderize' action creating empty submeshes.

Runtime/Core/ProBuilderMeshFunction.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ internal void EnsureMeshColliderIsAssigned()
425425
#if ENABLE_DRIVEN_PROPERTIES
426426
SerializationUtility.RegisterDrivenProperty(this, collider, "m_Mesh");
427427
#endif
428-
429-
collider.sharedMesh = mesh;
428+
collider.sharedMesh = (mesh != null && mesh.vertexCount > 0) ? mesh : null;
430429
}
431430
}
432431

0 commit comments

Comments
 (0)