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
- “FMOD failed to set the software format to the custom sample rate…” warnings are thrown as System Sample Rate value is being changed in Audio section of Project Settings window
- VFX Marquee selection does match the visual indicator
- “Invalid AABB aabb” errors are spammed when “Infinity” value is entered in Collider Component fields
- Editor Role does not sync with the MPPM Play Mode Scenario Role when entering Play mode
- Long asset names cause overlap with the “Find” function in search result tabs
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.