Box collider 2D failing when far from location 0,0,0

I’ve been having a problem where a box collider 2D doesn’t generate a collision shape. The message that gets displayed in the inspector window (while playing in editor) is:

“The collider did not create any collision shapes as they all failed verification. This could be because they were deemed too small or the vertices were too close. Vertices can also become close under certain rotations or very small scaling.”

I believe this is actually related to the game object’s location in the world. The object is far from the world origin of 0,0,0 and I’m wondering if that’s the cause? For example, when I place the object at location 3731,-3621,0 I get the problem. However if I move the object 1 unit over to location 3732,-3621,0 I don’t get the problem.

I’m trying to understand the behavior here, but I’m not sure what’s causing this.

Some additional info:

  • The game is a 2D game using only Unity 5’s built in 2D support

  • The game object in question has a sprite renderer and a box collider 2D

  • The game object’s rotation is 0,0,0 and the scale is 1,1,1

  • The box collider’s size is 1x1 (with no offset)

Does anyone have a guess as to what’s going on here?

Thanks for any help!

Shawn

This is extremely odd behaviour. The warning only appears when the box-shape being presented to Box2D is too small due to its inherent size or via down-scaling. Its position has no relation to it.

Presumably the GameObject is a root object i.e. has no parent that has down-scaling/rotation applied?

If not, can you please submit a bug report for this and post the case number?

Hmm that’s interesting. I wish I had the source code so I could fix this, haha.