Search Issue Tracker

Status: Fixed in Unity 5.6.0

Votes

6

Found in

4.6.0b17

Issue ID

637042

Regression

No

OnTriggerExit2D is not happening when other colliding object is beeing destroyed

Physics2D

-

-

Priority: 3Not yet prioritized for a release

-

Severity: 0Severity not yet defined

To reproduce this bug:

1. Open the attached project
2. Open 'OnTriggerExit2D' scene
3. Play the scene
4. Notice that object is instantiated and OnTriggerEnter2D is triggered
5. Notice when the object is destroyed OnTriggerExit2D is not triggered and does not work

Comments (3)

  1. Fcdb37e437c301b5d0025d03ef2610ad?d=mm

    Zoser

    Apr 29, 2016 00:05

    This also happens when you disable the collider. OnTriggerExit2D is not called at all, though OnTriggerEnter2D is called when you enable the collider.

  2. 5c920d99262a498ab100061c7d36850e?d=mm

    burritoco

    Feb 08, 2016 04:49

    I would love to know something about Unity's thoughts on this. This would be a very useful thing to have.

  3. 05d66a001de1c03c6d081dc25c2271f6?d=mm

    Cine

    Mar 06, 2015 05:36

    I presume it is intended, since the object didn't really exit, it just disappeared. Plus the fact that this happens during Physics update, whereas the destroy can happen in any phase.

    But it would be really nice if there was an OnTriggerDisappear() that would be called when the collider is destroyed or disabled, or the game object it is on is disabled.

All about bugs

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