Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2021.1.X
Votes
0
Found in
2020.3
2021.1
2021.1.0b10
2021.2
Issue ID
1321270
Regression
No
EdgeCollider2D Adjacent Endpoints result in inverted separation normals when using Collider2D.Distance
Reproduction steps:
1. Open attached project "Edge Collider Distance Normal Bug.zip" and scene "SampleScene"
2. Enter Play Mode
3. In Game View, observe the 'Left Circle' and 'Right Circle' GameObjects and their red and blue lines
Expected result: The 'Left Circle' and 'Right Circle' red lines overlap with their blue lines
Actual result: The 'Right Circle' red line doesn't overlap with its blue line
Reproducible with: 2020.3.3f1, 2021.1.1f1, 2021.2.0a12
Could not test with: 2018.4.33f1, 2019.4.23f1 (compilation errors break project)
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2021.2):
Box2Ds contact creation assumes there'll be a continuing edge when setting adjacent edge points and this is normally true but for this use-case, there isn't so no contacts were created and the Unity code has to provide a best-guess fallback which is different than what would be returned without the adjacent edge. When using the Distance method against an EdgeCollider2D, we temporarily disable adjacent start/end points which resolve the low-level Box2D issue here.