- Home /
Unknown EditorApplication.SaveScene() errors
I'm trying to automate some things with unity. So far it works good, but I am concerned about these errors I get.
For example: 1) I call EditorApplication.OpenScene(); 2) Search for an object in the hierachy. 3) Call DestroyImmediate() on the object. 4) EditorApplication.SaveScene();
Everything works great until the SaveScene() call. Right after I call this, the unity console results in multiple entries of the following error:
"Failed to unpersist: Not loaded ID: 170180 FileID: 400001 UnityEditor.EditorApplication:SaveScene(String)"
Where the numbers are different almost every time. What I'm doing is looping through the scenes, deleting 1 or more objects from each scene and resaving them. Opening another scene, deleting, saving.
From what I can tell, it saves ok. But the errors clutter the console. As a possible workaround, I attempted to saving using MenuItem.ExecuteMenuItem( "File/Save Scene" );, but it doesn't recognize that particular menu entry.
When the script is done executing, it also throws similar errors but it is from "UnityEditor.DockArea:OnGUI()" instead.
Any ideas what any of these errors mean? I'm concerned that these errors are bad in ways I don't understand.
Thanks!
Did you ever find a solution? I just started getting this error too. $$anonymous$$y script was working fine before, so some change I made recently has caused this, though I don't know what.
Someone find the solution? I'm with the same error, and I don't know what's happening. Anyone can help me? Thanks!
Answer by vzasadnyy · Feb 17, 2014 at 04:19 PM
Probably you are trying to save scene with wrong file extension, correct one is [scene name].unity
Your answer
![](https://koobas.hobune.stream/wayback/20220613125513im_/https://answers.unity.com/themes/thub/images/avi.jpg)