- Home /
Box Collider 2d don't collide
I'm simply putting a sprite with Box Collider 2D and Rigidbody2D on ground with box collider 2d, the sprite transpass the object, I dont know if this is a bug of my unity because this is a really idiot and noob question.
The only warn that appear 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 scaled so much times bigger and smaller, checked everything, why this dont work ?
EDIT:[WHAT THE HELL ???] When I start the scene with crate (see my another post below) as isKinematic and click play, if I desactive isKinematic the collision works ! If I start the scene with isKinematic disabled it transpass the object
Not sure if this will help with your problem but it is worth a try :
http://docs.unity3d.com/ScriptReference/Rigidbody.WakeUp.html
I'm laugting here $$anonymous$$rSoad, I tested what you said, It dont worked but I found the problem, Unity is not recognizing Rigidbody2D check this error message when I add the WakeUp: $$anonymous$$issingComponentException: There is no 'Rigidbody' attached to the "box" game object, but a script is trying to access it. You probably need to add a Rigidbody to the game object "box". Or your script needs to check if the component is attached before using it.
Should have given you this link rather than the one above, the one above if for 3D not 2D. Give this a try :
http://docs.unity3d.com/ScriptReference/Rigidbody2D.WakeUp.html
Another weird thing, If I put gravity scale 0.1 on Rigidbody 2D it works, Its like "Object is too fast at normal speed" The normal gravity Scale is 1
What is your actual scale, put a std Unity cude (3D) in your scene. If it looks huge then you have your whole scale far to small. The cube is 1m in diameter but the physics engine does not like it when small things are modeled at their real life size (a pool table and balls will not work well at the correct real life scale). So it is best to try and have your main objects, player etc, at around the size of the std Unity cube.
Answer by BenZed · Dec 18, 2014 at 10:39 PM
Typically, when you place a BoxCollider on a sprite, it expands the box to fit the sprite. The question here is why it isn't doing that. Is your sprite transparent?
In any case, you can set the collider bounds manually in the inspector.
I've uploaded a working example, use it to compare what's going wrong.
Its not transparent, I applied box collider 2d on the ground and box collider 2d + rigidbody 2d on your crate and dont worked
Answer by Fred_Vicentin · Dec 19, 2014 at 01:37 PM
My sprite is not transparent, I can see the collider, but it transpass object EDIT:[WHAT THE HELL ???] When I start the scene with crate as isKinematic and click play, if I desactive isKinematic the collision works ! If I start the scene with isKinematic disabled it transpass the object Check what I done
Your answer
Follow this Question
Related Questions
2D Colliders bug. 1 Answer
2DColliders going through eachother 1 Answer
My player is unexplainably destroyed when collides with a collider 0 Answers
Best solution for making arc collider 0 Answers
2D Physics Problem? 1 Answer