Search Unity

OnCollisionEnter2D called several times when collision is circle

Discussion in '2D' started by lllMartinlll, Feb 4, 2014.

  1. lllMartinlll

    lllMartinlll

    Joined:
    Feb 4, 2014
    Posts:
    1
    OnCollisionEnter2D only called once when Box Collision 2D made contact with another. But when I change it to Circle Collision, it called several times (call times seem depend on velocity), is that normal?

    Thanks everybody.
     
  2. unitylover

    unitylover

    Joined:
    Jul 6, 2013
    Posts:
    346
    Yes it's normal. The way I worked around the issue was to create a boolean flag that was checked at the beginning of the function. I set the flag to false again after the collision exit happened.