Hello.
I’m using MacOS with Unity 6000.0.30f1, but
I’m keep receiving this annoying error:
You may not pass in objects that are already persistent
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEditorInternal.InternalEditorUtility:SaveToSerializedFileAndForgetInternal (string,UnityEngine.Object[],bool)
UnityEditorInternal.InternalEditorUtility:SaveToSerializedFileAndForget (UnityEngine.Object[],string,bool) (at /Users/bokken/build/output/unity/unity/Editor/Mono/InternalEditorUtility.bindings.cs:271)
UnityEditor.Build.Profile.BuildProfileContext:OnDisable ()
Although this error occurs, everything works quite well.
But I wonder why Unity Engine is keep throwing this error out of nowhere.
For your information, with Unity 2023, this error only occured after a force quit and relaunch.
It could be because you have at least 2 scripts with DoNotDestroyOnLoad method on the same GameObject. I also heard that it could be issue and with Build Profiles but I think that is unlikely.
Yes, right now it is Holiday and I am coding alone in my room by day and night.
I had the same issue after importing a model from the asset store. Fixed it by doing Assets → Reimport All (in the Project window), Unity fully reloaded the project and the error was gone.
consistently having this issue with Unity 6000.0.23f1, reimporting all assets works but only until the next opening of the project, so its not a solution.
Error occurs on every domain reload.
It’s very annoying to see an error appear on every domain reload.
On Windows with version 6000.0.26f1 and just ran into this problem too after opening a fairly big project to make a WebGL build.
Reimporting all assets fixed it enough for me to at least make the build.
Same issue, I don’t have DoNoDestroyOnLoad methods on any of my scripts on any gameobject, so that is unrelated.
Opening a clean project and letting it reimport the library and recreate all the objects folders does not generate this errror, subsequent openings of the project will spam this message throughout my usage of Unity, builds are fine, player runs fine, its just some Unity bug with build profiles I’m sure. They had one at the start of Unity 6 with localization files as well, they just need to put the time in to investigate this one.