Search Issue Tracker

Fixed

Votes

4

Found in

4.3.0f1

Issue ID

573682

Regression

No

OnTriggerEnter2D called too many times

Physics2D

-

To reproduce:
1. Open the "Unity Projects 02: 2D Platformer v2.1" from the Asset Store
2. Open the scene called "Level"
3. Attach a script with "void OnTriggerEnter2D() { Debug.Log("enter"); }" to "hero"
4. Run the scene
5. Notice how "enter" is logged many times when player gets thrown to the river by zombies (dies)

Comments (24)

  1. GarthWood

    Jan 25, 2014 13:24

    I guess I should read the comments properly first :P

  2. GarthWood

    Jan 25, 2014 13:21

    Still happening in 4.3.3f1 when manually setting the position of the transform. It works fine when using AddForce(). This needs to be fixed. It's the foundation of 2D triggering using manual position updates.

  3. MelvMay

    Jan 23, 2014 11:15

    This has been fixed is not in the 4.3 release but has indeed been fixed for a future release.

    The relationship with the Animator component is that there was also a bug in that component which caused other components to update their transform position (even if you were not animating it). In the case of the 2D physics, this caused a RB update which then caused a re-evaluation of contacts resulting in a new "Enter" callback.

    Two things have been fixed. The first is the problem in the Animator component and the second is that the 2D physics now keeps the Enter/Stay/Exit callback state even if Box2D re-evaluates contacts.

    Unfortunately, this fix missed the deadline for any 4.3 fixes of this severity and will be in a future release.

  4. KaKaGo

    Jan 17, 2014 09:05

    still in 4.3.3f1.
    OnCollisionEnter2D has the same bug on concave Polygon2D

  5. Fazel

    Jan 13, 2014 17:34

    I got the same bug. And the Stay event is bugged too in 4.3.0f4

  6. Pat-AfterMoon

    Jan 11, 2014 17:27

    This Bug is really still present in 4.3.1f1, please, remove this "fixed" status!

    If you take the "Unity Projects 02: 2D Platformer v2.1" as an example, It seems to be related to the Animator component, because if you deactivate this component, this bug doesn't occurs anymore.

  7. Andrige_

    Dec 16, 2013 01:15

    Bug still present in 4.3.1f1.

  8. diegzumillo

    Dec 08, 2013 19:24

    I'm still on the 4.3.0f4 and this bug is still there.

  9. Tortuap

    Dec 08, 2013 00:06

    Still in the 4.3.1f1

  10. AndreiKubyshkin

    Nov 24, 2013 07:13

    Maybe your trigger object is moving? When trigger is moving and there's no rigidbody2d component on trigger object, it behaves strange, shooting OnTriggerEnter many times.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.