Search Issue Tracker
Duplicate
Votes
14
Found in
2019.4
2020.3
2021.3
2021.3.2f1
2022.1
2022.2
Issue ID
1426900
Regression
No
Error "Destroy may not be called from edit mode! Use DestroyImmediate instead." is shown when exiting Play Mode
How to reproduce:
1. Open the attached project "UIToolTip"
2. Click Play
3. Click Play again to exit Play Mode
4. Observe the Console
Expected result: Console shows no errors
Actual result: Console shows "Destroy may not be called from edit mode! Use DestroyImmediate instead." error
Reproduced in: 2019.4.38f1, 2020.3.33f1, 2021.3.1f1, 2022.1.0b16, 2022.2.0a15
Reproduced on: Windows 11 Pro
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
- Packman: The same asset data is displayed differently in "Import" and "Remove" popups
- Reference to a deleted GameObject becomes "None" instead of "Missing" when the GameObject is restored with undo after entering and exiting Play Mode
- Size value in Particle System Curve's tab is highlighted with selection across all tab header
- Particle System Curve's Presets window has no visual indication of what preset is selected
- Blur shader doesn't work when the "Scene Color" Node is attached to the UI "Output" Node
sugiharam2
Mar 10, 2024 03:47
When I tried downgrading the InputSystem version, the error disappeared.
Unity 2023.2.13f1
Input System 1.7.0 > error
Input System 1.6.3 > error
Input System 1.5.0 > no error
Don't use Input System > no error
berber_hunter
Dec 29, 2023 17:24
This is not resolved!!!!
Pchan_Cegepdefi
Dec 11, 2022 07:31
[Solution] I had the same problem. I double clicked on the error message and the script "EventSystem.cs" opened at line #413. The error said "Use DestroyImmediate instead". So I replace the line "panel.destroyed += () => Destroy(go);" TO "panel.destroyed += () => DestroyImmediate(go);"
bilalakil
Oct 03, 2022 00:00
Also looking for the duplicate ticket so I can vote on it. Note that this bug prevents some build attempts from succeeding.
generatedgoblin
Aug 12, 2022 13:10
Can't find the duplicate, can this be re-opened?
severeZzz
Jun 14, 2022 17:35
Could you please add a link to the original ticket? "Duplicate" is not informative.