Cancel OnDestroy when changing scene
Hello,
I would like to know if there's a way to prevent using the OnDestroy function when you change a scene.
I have some GameObjects that instantiate a new object when destroyed, but when I stop simulation or change scene Unity destroy all existing GameObjects but since it create new ones, Unity send me an error telling me that some objects weren't cleaned up.
It doesn't seem to make any other errors so it's not really problematic but I prefer to have a clean code without error
Thank you in advance :)
Comment