Search Issue Tracker
By Design
Votes
1
Found in
2022.3.13f1
2023.1.19f1
2023.2.0b17
2023.3.0a13
Issue ID
UUM-55657
Regression
Yes
”OnTriggerExit2D” is called after exiting Play Mode when trigger colliders overlap
How to reproduce:
1. Open the user’s attached “TriggerBug.zip” project
2. Open the "SampleScene" Scene (Assets > Scenes)
3. Enter Play Mode
4. Hold the “D” or “right arrow” button
5. When the Cube gets on top of the other Cube GameObject exit Play Mode
6. Observe the Console window
Expected result: “exited” log is not logged
Actual result: “exited” log is logged
Reproducible with: 2022.2.13f1, 2022.2.21f1, 2022.3.13f1, 2023.1.19f1, 2023.2.0b17, 2023.3.0a13
Not reproducible with: 2021.3.332f1, 2022.2.12f1
Reproduced on: macOS 13.5.2 (Intel)
Not reproducible on: No other environment tested
Note: not reproducible with “OnTriggerExit”
-
theboxfriend
Nov 09, 2023 21:16
If this is intended behavior, is there a reason that the behavior is not the same for the 3d messages like OnTriggerEnter?
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Search: Inspector section icon is less sharp/more pixelated than other editor icons
- Search description string is always truncated
- [VFX] When Grouped Nodes are converted to Subgraph Operator resulting Graph Node is not included in the Group
- Search window icons are less sharp/more pixelated than other editor icons
- The Inspector can be covered when scaling the horizontal separator bar
Resolution Note:
https://issuetracker.unity3d.com/issues/ontriggerexit2d-not-called-when-colliders-are-disabled-due-to-getting-unloaded
Exit callbacks on any 2D collider should be called when the collider is disabled, the GameObject is destroyed or the scene is unloaded.
If you wish to avoid this behaviour then you can disable: https://docs.unity3d.com/ScriptReference/Physics2D-callbacksOnDisable.html
This change was as result of a fix via: https://issuetracker.unity3d.com/issues/ontriggerexit2d-not-called-when-colliders-are-disabled-due-to-getting-unloaded