Search Issue Tracker

Fixed in 4.5.2

Votes

10

Found in

4.5.0f6

Issue ID

610864

Regression

Yes

Box Collider 2D does not collide when its size is small (like 0.01)

Physics2D

-

Reproduced with:
Unity Version 4.5.0f6 (fd4616464986)

Resolution:
4.5 includes the latest Box2D which fixes a number of issues, one of which is correctly handling colliders (fixtures) that are too small. When Box2D encounters a collider that is too small it simply throws an assert. To counter this we perform the exact same checks that Box2D does including checking for vertex being too close, colinearity, and area being too small.

If any of these checks fail we simply don't create the Box2D collider. We don't push this as a warning to the console as this would cause a lot of spam to be generated. You will notice that the gizmo doesn't render in this case.

Upon further consideration, we feel that simply not rendering the gizmo isn't adequate so in Unity 4.5.1 (patch 2) we are adding a warning on the collider indicating that it couldn't complete the request to Box2D.

In all cases where you previously were using polygon/box to produce very thin colliders, it is highly recommended that you use the edge collider instead.

Comments (12)

  1. Fd6f08f6edec3cbcbc13ca6342270df5?d=mm

    engrato

    May 31, 2014 14:27

    Anything below this value makes the collider gizmos disappear from the scene view.

  2. Fd6f08f6edec3cbcbc13ca6342270df5?d=mm

    engrato

    May 31, 2014 14:25

    I also noticed this behaviour. From what I tested, the minimum value is 0.05.

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.