- Home /
Unity crashed and I lost entire scene. Can it be recovered?
So, I have been working on a unity project for some time, I made nice scene, but today, unity crashed and my scene was lost. I didn't had any backups because the last thing that would come into my mind is loosing scene like this. Anyway, does anybody know the way how to get it back? I have menaged to restore some unity temp files, that were lost, but looks like they have nothing to do with the scene. Also, I have my game with this scene built, so maybe there is way to restore scene via built game? Anyway, if there is no way to restore this, I am happy that it happen now, because it could have happen in about a year, when I may had finished my game, so only thing that will be left to me then is to kill myself.
Sorry to hear about this. When you say the scene was lost, do you mean the scene asset is missing from the project assets folder, or the scene is now empty?
I don't personally know of a way to investigate recovery, so let's see if anyone has advice. I hate to be that guy, but the best advice is making frequent backups. I backup my projects to discrete harddrives daily.
Scene totaly gone, but every other project asset stayed (fortunately). Yes, I know now that I must do frequent backups. I was lucky that I have been doing a lot of learning on this scene, so it is not huge lost. I think that I can recover everything in about 2-3 hours.
But, i can't even imagine that it could happen in future, and all my work (maybe year long) could have be lost... This is nothing so serious, now. :)
If you havent reopened unity since the crash, search your temp folder and find "__Edit$$anonymous$$odeScene". If youve opened unity, its gone
I have menagged to recover it via program called "Recuva", but it won't load the scene, it is damaged, corrupted, I don't know...
this won't help you right now, but will help in the future- get a bitbucket.org or github.com account and use git to back everything up to a remote repository. Do this every time you complete a feature- ideally several times a day. it's free and will save your from heartache.
Answer by FairGamesProductions · Nov 07, 2014 at 10:07 AM
This is why I have made saving the scene a reflex. I basically hit Ctrl+S after every change to the scene. Sometimes Unity WILL crash, so making saving a habit helps minimize the damage. Because if it crashes before the first save, you will loose the entire scene. And as an added precaution, use 7Z to make backups of your project folder when going to bed.
Don't restart Unity until you recover your temporary file.
We did the same thing @FairGamesProductions. Saving both the project and the scene repeatedly, our scene was obliterated immediately when restarting Unity after it stopped responding.
All the best luck!!!
Answer by meat5000 · Feb 10, 2016 at 06:38 PM
Answer by Eric5h5:
http://answers.unity3d.com/questions/13920/editor-crash-where-is-scene-data-kept.html
Provided you do not load Unity straight away after the crash, you can recover your scene.
Answer by MMOERPG · Dec 29, 2019 at 11:03 AM
This just happened to me, after a few deep breaths, I checked the recycle bin.
Answer by PrimeSoul · Dec 29, 2019 at 01:05 PM
do your self a favour and add this to every project you start, it has helped me countless of times where i would have lost allot of stuff:
Create a c# file named "AutoSave"
/// <summary>
/// AutoSave.cs, editor helper script. Saves the scene ans modified assets when you hit Play in the Unity Editor, so if Unity should
/// crash, or similar, you don't lose any scene or assets you haddn't saved before hitting Play.
/// </summary>
///
/// <remarks>
/// Created (date - name): 10th March 2015 - Gavin Thornton
/// Modified (date - name): 8th Jan 2017 - Gavin Thornton - #if UNITY_EDITOR moved to fix cloud build
/// Modified (date - name): 30th March 2017 - Gavin Thornton - line "EditorSceneManager.SaveScene(EditorSceneManager.GetActiveScene());" changed to multi scene version "EditorSceneManager.SaveOpenScenes();"
/// </remarks>
#if UNITY_EDITOR
using System;
using System.IO;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
[InitializeOnLoad]
#if false // Change this to "#if true" if you want to disble the script temporarily (without having to delete it)
public class OnUnityLoad
{
static OnUnityLoad()
{
EditorApplication.playmodeStateChanged = () =>
{
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
Debug.Log("*** WARNING:Auto-Saving DISABLED ***" + EditorApplication.currentScene);
};
}
}
#else
public class OnUnityLoad
{
static OnUnityLoad()
{
EditorApplication.playmodeStateChanged = () =>
{
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
{
// Unity 5+
Debug.Log("Auto-saving scene and any asset edits" + EditorSceneManager.GetActiveScene());
EditorSceneManager.SaveOpenScenes();
AssetDatabase.SaveAssets();
// Old code for Unity 4.6 and below users below -------------------
//Debug.Log("Auto-saving scene " + EditorApplication.currentScene);
//EditorApplication.SaveScene();
//EditorApplication.SaveAssets();
}
};
}
}
#endif
#endif // #if UNITY_EDITOR
Answer by kkkkkkkkkkkkkkkkkkkkkkkkkkkkk · Jan 18, 2020 at 09:58 PM
I had the same problem two times, a scene was lost with all the work in it. Very bad.The file size of the scene was 0 kb. Deleted. The other scenes were compete. No way to get it back because the file is empty. Now I dont just save it but duplicate it by the time and I have a really saved copy. In a crash the open screne sometime is lost, saved or not, totally with all elder savings. The problem occoures while using one project on two machines with the same file on a mobile hard drive. Now I always make a own copy before using it on the other one. This seems to work. But quiet expensive in diskspace and time.