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
- Resources.UnloadUnusedAssets() freezes the Editor when releasing Mesh objects
- 16-bit Sprite Textures have a banding effect and loss of data when packing into Variant Sprite Atlas
- HDRP Cluster artifacts when having more than 100 lights
- ParticleCollisionEvent.intersection generates extremely high values when particles collide while in Play Mode
- Custom attributes are not properly converted to subgraphs
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.