Editor error in unity 2018.3b8

UnityException: DestroyImmediate can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEngine.Object.DestroyImmediate (UnityEngine.Object obj) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:322)
UnityEditor.NormalCurveRenderer.FlushCache () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/CurveRenderer/NormalCurveRenderer.cs:649)
UnityEditor.CurveWrapper.Finalize () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/CurveEditor.cs:54)
UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)

I admit I have destroy inmediate in the scene, but havent got a clue where to start. By the way this message still allows me to play the scene…

Could you please submit a bug-report, as described in this document:

After you submitted the bug-report, you receive a confirmation email with a Case number. Please post this case number here for Unity staff to pick up.

2 Likes