Unity Issue Tracker - "Destroying object multiple times. Don't use DestroyImmediate on the same object in OnDisable or OnDestroy" Error is thrown when trying to replace a GameObject/Prefab with a different Prefab from the Context Menu's "Replace..." option
Closed
UUM-39900
"Destroying object multiple times. Don't use DestroyImmediate on the same object in OnDisable or OnDestroy" Error is thrown when trying to replace a GameObject/Prefab with a different Prefab from the Context Menu's "Replace..." option
Unity: Scene Management
Won't Fix
2023.2.X
2023.2.0a15 onwards
The issue is already fixed as from 2023.2.0a20.
Reproduction steps:
1. Open the attached “Repro.zip” project
2. Open the “Assets/Scenes/SampleScene.unity” Scene
3. Right-click on the “GameObject1” GameObject in the Hierarchy window
4. Select “Prefab” and then “Replace…” in the Context menu
5. Observe
Expected result: Another window pops up, which lets you to select a prefab, which is going to replace the selected GameObject
Actual result: “Destroying object multiple times. Don't use DestroyImmediate on the same object in OnDisable or OnDestroy” Error gets thrown in the Console window
Reproducible with: 2023.2.0a15, 2023.2.0a18
Not reproducible with: 2022.3.1f1, 2023.1.0b21, 2023.2.0a14
Couldn’t test with: 2020.3.48f1, 2021.3.
Reproducible on: Windows 10 Pro (22H2)
Prioritise and Follow this issue
Have a workaround or additional info about this issue?