- Home /
Small scale 2D colliders not working?
Why is it that sometimes 2D colliders don't work properly if they are scaled small? For instance, I have a bunch of trigger 2D colliders that are scaled like: x = .05, y = 10, and sometimes they show up and trigger, but most of the time they don't. It seems that if I move the object they are attached to around a little in the editor, I can get them to show up.
I would like to use vertical edge colliders instead of the Box2D, but those don't work at all. Is this a bug with Unity?
Answer by MelvMay · Apr 25, 2015 at 04:19 PM
Box2D has a limit on how close vertices can be as well as the total area for a collider. The vertices cannot be closer than 0.0025m (2.5mm) and the total area cannot be less than 1.192092896e-07F.
Thus 2D colliders are working however when they detect the above conditions then they cannot create the collider. When this happens, you get a warning in the inspector so you know it's happening and the warning even describes what's going on; surprised you've not seen it. When using a PolygonCollide2D which can create multiple collision shapes, if any of these collision shapes break the above condition then again you get a warning in the inspector.
Answer by lordlycastle · Apr 25, 2015 at 03:23 PM
That’s because Physics engine can only calculate collision so many times per second, so if the collider is so small that it would pass through other collider between two calculations, then it won’t detect it. Make the collider larger, or set the collision detection of the rigidbody to continuous dynamic. That would also improve is so much. You can decrease the velocity of the particles, then they might not pass through things.
Your answer

Follow this Question
Related Questions
Any way to get collider2d bounds? 1 Answer
Some collisions in 2D are not detected, how can I get them all detected? 1 Answer
How can stuff not be working while it works in another script.... 1 Answer
Draw CircleCollider2D radius ingame 0 Answers
Move a tile (sprite) with drag and drop in Unity 2D 0 Answers