Search Unity

Unity crashed, can i recover my lost hours of work ?

Discussion in 'Getting Started' started by narf03, Jan 1, 2017.

  1. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    223
    Its a Happy new year crash from unity.

    I saved all scripts but all scene settings are gone, hours of work gone, want to know if there is a way to recover it ?

    Thanks.
     
  2. Deleted User

    Deleted User

    Guest

    If you never saved your scene during these hours I'm afraid the answer is obvious.
     
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Sure. Simply reload your latest commit from version control. You are using version control with frequent commits, right?

    Since this is getting started, I should also point out that Unity doesn't always open a scene by default when a project opens. If you've saved the scene, it will still be in the assets folder.
     
    koxta likes this.
  4. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    223
    Hi, i have redo all my lost work without reading this. But i can foresee this wont be the last time unity can crash, I will need to know more about your "reload latest commit", can you explain a bit more ? I could not find anything within unity that match your description. Sure we all can benefits alot from it, please give us more details, thanks.
     
  5. Deleted User

    Deleted User

    Guest

    Kiwasi likes this.
  6. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    223
  7. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    It's called having a backup. Version control is just a very advanced form of backup. One that allows you to see the changes you've made in the past and even revert back to them if you decide your latest changes have broken things. It's very handy.
     
    Kiwasi likes this.
  8. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    223
    I know UFO is good to have, its good way to travel to other planets, but i need protection against crash atm, we will talk about UFO later, ok? =P
     
  9. Deleted User

    Deleted User

    Guest

    There is no protection against crashes; if Unity crashes and you have not saved your scene on a regular basis while you were working, your work is lost, that's it.
     
  10. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    Having a backup is protection against crashes (it's just reactive instead of proactive). If Unity crashes you simply order a checkout from your repository and continue along as if nothing had ever happened.

    By the way there are free autosaving editor extensions on the Asset Store with good reviews. Just in case you haven't gotten to the point where you spam Ctrl-S every few changes to your scene like I do. :p

    https://www.assetstore.unity3d.com/en/#!/content/38279
     
    Last edited: Jan 3, 2017
  11. Deleted User

    Deleted User

    Guest

    Not sure Unity needs more excuses to crash. ;)

    I do spam Ctrl+s each time I add something to a scene and each time I modify something in a scene and each time... oh well. :D
     
  12. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    223
    Yes, we can talk about UFO now.
     
  13. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You keep using that word. I do not think that word means what you think it does.

    What does UFO mean in the context of backups and version control?
     
  14. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    223
    UFO means unknown flying object, its supposed to be a joke, but seems im bad at that, anyway, i applied the "autosave" and it should solve my problem, cant tell until unity crashes.Thanks.
     
  15. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    He's using it as a metaphor (I think this is the correct word).
     
  16. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Got ya.

    Some things don't translate well across cultural gaps. A key tip for the future is to show a smiley face next to it. It clearly indicates you aren't meant to be taken seriously.
     
  17. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    218
    I just came across this topic from google, so I will let here the solution in case someone need it.

    You can recover your progress in your project folder > Temp >_Backupscenes > 0.backup

    Just rename it to "whatever.unity" and open it. You will have all the progress that you did before the last time you click play button
     
    XJonOneX likes this.
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you just not test by making a change in your scene, then exiting Unity without explicitly saving? No need to wait for a crash, right? And it should have been UFOs, plural, but let's not.
     
    Last edited: Jan 11, 2019
  19. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512


    The plural form of UFO would be UFOs. An apostrophe would only be needed if you were making the word a contraction:
    or possessive:
    Also this thread was resurrected from 2 years ago, so... might not be a real issue that needs solving anymore?
     
  20. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What apostrophe? :) But yeah, I probably should get my grammar right if I'm choosing to correct someone! Note to self...
     
    Schneider21 likes this.
  21. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    What... it was-- I just---

     
  22. TKDHayk

    TKDHayk

    Joined:
    Dec 22, 2015
    Posts:
    131
    What is I frequently saved my scene, but the scene is now corrupted and unity crashes if i open that particular scene. I have a single game object in the hierarchy of my scene that I need to recover. Is this possible?
     
  23. Bill_Martini

    Bill_Martini

    Joined:
    Apr 19, 2016
    Posts:
    445
    A game object by itself is just a transform (position, rotation, & scale) and I think that's pretty low value info, so I'm guessing you have components attached to that game object. Possibly a script? A script that might be causing the crash? Maybe you want values from a components inspector panel? You need to be more specific.

    If it is a script you can manually move it out of the assets folder in Explorer / Finder (PC / Mac) and you should be able to load into VS the same way. Removing a bad script may allow the scene to open to get other component info.
     
  24. TKDHayk

    TKDHayk

    Joined:
    Dec 22, 2015
    Posts:
    131
    Hey Bill,

    The crash was caused by removing a texture from a Unity terrain. I have no problem retrieving scripts from the crashed scene as they are all in the project folder. However, I am trying to retrieve my Player Controller GameObject from this Corrupted scene, which includes weapons and many sub components - this is a very complex player controller. more specifically, i am trying to retrieve my rocket launcher which is a child of my player. I always unlink game-objects from prefabs when updating them, and save them again as new prefabs when I am happy with the changes.

    Is there a way to view the Hierarchy of the Corrupted Scene without opening the scene? I simply need to either pull out my Player controller GameObject, or remove the corrupted terrain from the scene so that scene will load. I assume this can be done with a Hex editor? hoping for an easier solution.

    In other words, is it possible to retrieve a gameobject which was never made into a prefab, from a corrupted scene? I get that the real data is stored in the project folder and not the scene, but having to rebuild everything from the project components is difficult.
     
  25. TKDHayk

    TKDHayk

    Joined:
    Dec 22, 2015
    Posts:
    131
    for example, I have a UI canvas with health and energy meters, that was never made into a prefab. Can I retrieve those?
     
  26. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    Unity's scenes are stored in plain text as YAML (Yet Another Markup Language). You can try opening it and seeing if any of the data you need is still intact.
     
    TKDHayk likes this.
  27. TKDHayk

    TKDHayk

    Joined:
    Dec 22, 2015
    Posts:
    131
    Thanks Ryiah, good to know. for those facing a similar issue, I solved it by backing up my project and deleting any possible corrupt files (all terrain data), to allow my scene to compile. I was able to open my corrupt scene, prefabbed my desired GameObjects from the scene hierarchy, and exported those prefabs as a package to my backup. The "Export Dependancies" option selects all project files unfortunately. I found a workaround to this problem a year ago but cant remember now. anyway, problem solved.