Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4
2020.2
2020.2.2f1
2021.1
2021.2
Issue ID
1311101
Regression
No
Rigidbody2D.Distance is returning incorrect results when used between a Capsule Collider 2D and a rotated Box Collider 2D
How to reproduce:
1. Open the attached project (case_1311101-DistanceTest)
2. Open the DistanceTest Scene
3. Move the Collision Game Object around to see the expected behavior
4. Move the Collision Game Object to the (0, 0) position
Expected result: You can see the correct separation of the colliders
Actual result: The separation of the colliders is not visible
Reproducible with: 2018.4.30f1, 2019.4.19f1, 2020.2.5f1, 2021.1.0b7, 2021.2.0a4
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
- ArgumentOutOfRangeException when manipulating the Project Settings search bar
- [Linux] Touch freezes in Player when any mouse button is clicked
- UnityEngine.Rendering.Volume.OnEnable() is called twice before OnDisable() creating multiple copies of the same volume when a volume is enabled right after Domain Reload when entering Play Mode
- Hinge Joint transforms are reset when toggling the "useMotor" property
- Motion Vector texture reports incorrect Mesh data when Mesh is coming from off-screen
Resolution Note:
The basic solver that the script is performing does not take tiny floating-point errors into account. It produces a tiny overlap of "-0.0000000596046448" (effectively 59 nanometers) and it's negative. The script then continues to try to solve that but it just can't because it's way below the precision here.