- Home /
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
@SpacePilot1000 did you find a solution? I'm having the EXACT same problem:
2D, GameObject far from origin (e.g., 1500, -1500)
Box Collider 2D breaks down when I move it 1 unity around
Box Collider 2D is fine when it is near origin
GameObject only contains sprite renderer, Box Collider 2D
no parent to GameObject
@Taky - I haven't checked back on this issue in a while, so I'm not sure if it's fixed yet.
I just checked and the original bug I filed is still open and unresolved.
An additional point - I don't have this problem what-so-ever on a much older slower machine (this machine is 32 OS vs current 64 OS machine that currently has the problem).
Answer by MelvMay · Sep 10, 2015 at 07:05 AM
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?
Is there a solution for this? I am having the same problem. GameObject has a BoxCollider2D and works fine when near (0,0,0). At (2000, -19055) it gives the "Collider did not create warning".
I am not scaling nor rotating the gameObject and the collider size is Vector2(1,1) and offset Vector2(0,0). Transform scale of the entire gameObject is Vector3.one.
Answer by SpacePilot1000 · Jun 19, 2016 at 04:39 PM
Hmm that's interesting. I wish I had the source code so I could fix this, haha.