- Home /
OnTriggerEnter2D triggers before the collision
I have one circle game object with circle collider and one rectangle with box collider. When circle hits to one of the edges of the rectangle, OnTriggerEnter2D triggers. When I zoom in to collision point though they are really close to each other, I can see that both objects are not colliding. You can see this on first screenshot.
While playing with the editor I observed a strange behavior. From the Hierarchy window I selected the circle gameobject and then while pressing Ctrl I selected the rectangle gameobject. When I did this another collider emerged on top of the circle as can be seen on the second image. As you can see the new emerged polygon collider is colliding with the box. I am guessing this the reason of my problem.
As I said at the begining I have only circleCollider2D attached to the circle so I dont know what poygon collider is doing there.
Does any one have any idea how can i fix this issue?
Answer by dayone · May 22, 2015 at 09:54 AM
Following post solved my answer partially: http://forum.unity3d.com/threads/ontriggerenter2d-triggers-before-the-collision.326592/#post-2118422
"I don't know how far you zoomed in. If its realy close, check the min Penetration For Penalty (Edit - Project Settings - Physics2D). Lower this to a minimum of 0.0035 and look what happens now"
http://docs.unity3d.com/ScriptReference/Physics2D-minPenetrationForPenalty.html
Your answer
Follow this Question
Related Questions
CircleCast hits emitter with Collider2D 0 Answers
Can't detect colliders from Tiled 0 Answers
2D collision won't work? 2 Answers
How can you change a colliders shape on collision with another collider? 1 Answer