Search Issue Tracker

Fixed in 2019.1

Votes

0

Found in

2018.2.3f1

Issue ID

1071700

Regression

Yes

OnTriggerExit2D is not being triggered when disabling other GameObject with a Trigger

Physics2D

-

How to reproduce:
1. Open user's project.
2. Press Play.
3. Press 'Appear' button in the Game View.
4. Press 'Gone' button in the Game View.

Expected result: When disabled, GameObject's trigger triggers OnTriggerExit2D
Actual result: When disabled, GameObject's trigger does not trigger OnTriggerExit2D

Reproducible with - 2018.3.0a10, 2018.2.6f1, 2018.1.9f2, 2017.4.10f1, 2017.2.3p4, 2017.2.2p4
Not reproducible with - 2017.2.2p3, 2017.1.4p2

Comments (1)

  1. 8300b3270eefea234f68d0bf27418e2a?d=mm

    mhardy

    Jan 14, 2020 19:21

    Is there any way to disable this "fix"?

    I can see how some might consider this a bug, but I don't. If a GameObject is disabled, that is a very different action then it exiting a collider. It's been this way for years and I have one game that relies heavily on this behavior. This seems like a massive breaking change.

    For example, my game relies on doing certain actions if, for example, an enemy ship leaves the playing field and thereby hits a border and fires OnTriggerExit2D. This Exit logic previously only ran if the ship actually hit the collider, now it's running for every single object that enters the play area - weather it actually leaves the border or is simply disabled.

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.