- Home /
Box Collider 2D -failed verification- warning even when the size is reasonable
I have a script that is executed in Edit Mode, it creates various gameobjects with a Box Collider 2D component attached to each one of them, and rotates their transforms based on a logic in my game. The problem is that some of those Box Collider 2D components fire this warning after they're set:
" 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. "
As I change the rotation from the inspector of some of those created GOs, the Box Collider 2D component works again, so the warning is due to their rotations. Also note that the scale isn't the problem as it's set to 1.
My question is, what do the "working angles" have in common? I can take into account this information in my script to only include those specific angles and therefore generating working Box Colliders. It would be better if there was a solution for this problem regardless of the transform's rotation.
Bit of background; here's what happens if you have tiny colliders (Not checked in Unity 5)
http://answers.unity3d.com/questions/539929/can-somebody-explain-this-its-alive.html
Here's some more concerning 5: http://forum.unity3d.com/threads/change-physics2d-scale.268776/#post-2072421
Answer by Dewald_Bodenstein · Mar 31, 2016 at 12:43 PM
I've just found that, as soon as the rotation is about 90 degrees around the Y or X axis, the BoxCollider2D breaks. As I understand, this would be because its like scaling the collider down on one axis and it ends up being too small.
I am using 3d objects in my scene so the rotation can be necessary. The solution would be to attach the 3d object to a child and rotate the child instead.
Your answer
Follow this Question
Related Questions
Ghost collisions problem: RigidBody player bounces, when moving on platform edges 2 Answers
Get rid of certain warnings on the console. 1 Answer
Collision interpenetrating between 2 meshes 1 Answer
get only one colliding body 3 Answers
Is it possible to detect collisions between 2d and 3d objects? 2 Answers