- Home /
OnCollisionEnter2D called once on colliding with 2 objects
I have a CircleCollider2D in a RigidBody2D, falling through the air and hitting the ground and a wall. If I hit either the ground or the wall first, OnCollisionEnter2D is called for both collisions. If I hit them simultaneously, it is called only once, for the ground. (nb it does actually bounce as expected, it's just not calling OnCollisionEnter2D as expected)
What could possibly be causing this? I thought it should be called once for each object it collides with.
NB All my gameObjects are untagged, and sit in the Default layer. None of the colliders involved are triggers. How can a rigidbody2D with circleCollider2D bounce off boxCollider2D, without a call to OnCollisionEnter2D? As it's only failing when it collides with another object simultaneously, it is likely to be related to this...
Also, I tried catching the OnCollisionEnter2D in the Wall's script, but again, it is only called if the Wall is the only object the CircleCollider2D is colliding with
Did you ever find an answer? I'm having exactly the same problem - I have a projectile bouncing across the ground, then bouncing off a wall and co$$anonymous$$g back. It triggers OnCollisionEnter2D just fine when it's hitting either the ground OR the wall, but despite the fact that physically it bounces exactly right when it hits down in the ground-wall corner (colliding with both in the same FixedUpdate), it does NOT trigger OnCollisionEnter2D for the collision with the wall.
Your answer
Follow this Question
Related Questions
OnCollisionEnter2D Questions 0 Answers
OnTriggerEnter2D not triggering 2 Answers
Unity2D side collision detection 1 Answer
How to change the color of the ball after hitting square? 5 Answers
Collision on specific Frames 1 Answer