Search Issue Tracker

Fixed in 2020.1

Fixed in 2019.2, 2019.3

Votes

0

Found in

2019.1.3f1

2019.2.0b1

2019.2.5f1

2019.3.0a1

2020.1

Issue ID

1190643

Regression

Yes

[2D] CompositeCollider2D polygon generation is inconsistent when using tilemaps

Physics2D

-

How to reproduce:
1. Open the attached project ("case_1190643-UnityCollisionBug.zip")
2. Open the repro scene ("SampleScene)
3. Select the tilemap grid in the scene and inspect it's generated collider
4. Open a tile palette
5. Add an extra red square to the right of another red tile in the scene
6. Notice the newly added edge in the collider
7. Turn the "Tilemap Collider 2D" component off and on again
8. Inspect the colder in the scene

Expected results: The geometry remains the same
Actual results: The newly added edge is removed

Reproducible with: 2019.1.3f1, 2019.1.11f1, 2019.2.0b1, 2019.2.10f1, 2019.3.0b8, 2020.1.0a9
Not reproducible with: 2017.4.33f1, 2018.4.11f1, 2019.1.2f1, 2019.1.0a1, 2019.2.0a14

  1. Response avatar

    Resolution Note (fix version 2020.1):

    The unstable collision-detection was caused by Box2D allowing a degerate polygon through. In this case it was a triangle whose vertices were fractionally off being collinear but still producing an extremely small area. Adding in a more robust near-collinear vertex check solves this issue. Fixing the "consistency" of tilemaps colliders would require a fundamental change in how authoring incremental changes works, and is not addressed in this fix.
    Fixed in: 2019.2.14f1, 2019.3.0b13, 2020.1.0a15

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.