Search Issue Tracker
By Design
Votes
0
Found in
2020.3.46f1
2021.3.20f1
2022.2.9f1
2023.1.0b6
2023.2.0a4
Issue ID
UUM-28804
Regression
No
Physics.ComputePenetration returns false when a non-convex MeshCollider is overlapping a CapsuleCollider
How to reproduce:
1. Open the attached Project "penetrationTest" and load Scene "SampleScene"
2. In the Hierarchy, select the "PenetrationLogger" GameObject
3. In the Inspector, right-click the "Penetration Info Logger" Component and click "Log"
4. Observe the Console
Expected result: Physics.ComputePenetration returns true
Actual result: Physics.ComputePenetration returns false
Reproducible with: 2020.3.46f1, 2021.3.20f1, 2022.2.9f1, 2023.1.0b6, 2023.2.0a4
Notes:
- Toggling the MeshCollider in the Scene to be convex makes Physics.ComputePenetration return the correct result
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
The capsule is rejected because it's penetrating the triangle of the non-convex mesh from the backside. PhysX has no option to not ignore these cases and thus the docs state:
"Ignores backfaced triangles and doesn't respect Physics.queriesHitBackfaces."
https://docs.unity3d.com/ScriptReference/Physics.ComputePenetration.html