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

  1. 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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.