Saving the scene w/ Javascript
I have been trying to figure out how to use the link:editorapplication.SaveScene and I can't see to get it to work. I would appreciate if anyone who knows how to use this feature could give an example of how to make this work (with javascript). The path that I am trying to save it to is Assets/Saves/Save1.unity. Also I would like this to be a save as. Thanks
Answer by Jato · Jan 06, 2016 at 09:28 PM
Okay after hours of trying to figure this out and I'm posting this for anyone following the question here is how you autoSaveAs your scenes:
#pragma strict
import UnityEditor;
function Start () {
}
function Update () {
EditorApplication.SaveScene(FileLocationInQuotes, true/false);
}
true means save as false means overwrite. FileLocation example: "Assets/Scenes/SceneName.unity I recomend adding a timer to the save because it causes a lot of lag trying to save every frame.
Your answer
![](https://koobas.hobune.stream/wayback/20220612055121im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Problem with saving player data 0 Answers
How can i save random-generated maps during gameplay ? 1 Answer
How can I load sprite from previous scene? 1 Answer
Save/Load Player System 0 Answers
Play mode forcing Scene save 1 Answer