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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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