Search Issue Tracker
By Design
By Design in 2023.2.X
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
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
Resolution Note (2023.2.X):
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