Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity major progress lost!

Discussion in 'Scripting' started by Davidw123, Apr 15, 2013.

  1. Davidw123

    Davidw123

    Joined:
    Jan 18, 2013
    Posts:
    43
    Hi guys,

    recently had a problem with one of my scripts that wouldnt compile; i had a backup from a days progress so loaded that into the scene so I could compare... its asked if i wanted to reload the scene or ignore... i ignored.. Ive since closed the scene and reloaded and its overwritten my current script... is there anyway to fix this!
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    whilst this is probably of no comfort... I'd like to thank you for highlighting this. You just saved me from a similar fate!!

    I ran into this when I had edited a script, but failed to save it (I'd added a type that didn't exist yet). Then created a new script in the project and double clicked to open the new file (to create the type and set it up with the vars it needed).

    At the prompt to reload the scripts I kept hitting cancel until eventually getting to a prompt to save the changes to the first script.
     
  3. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    i don't think there is an easy way to get your initial file back.
    to avoid such problems developers usually use some version control software. this creates not simply plain copies of the project but keeps track of changes and can compare and (partially) restore commits.
    look up subversion, git or mercurial. also its usefull to store the repositories in different places incase your harddrive fails. there are some web/cloud services for that but you can also use dropbox or similar webspace.
    i use this: http://www.h4ck3r.net/2010/05/11/mercurial-hg-with-dropbox/
     
  4. Davidw123

    Davidw123

    Joined:
    Jan 18, 2013
    Posts:
    43
    Cheers Guys,

    ive managed to get a large majority reprogrammed quickly but im still behind :(
     
  5. funnyrickyboy

    funnyrickyboy

    Joined:
    Jul 22, 2022
    Posts:
    8
    Hi, so I was working on my Unity project, and my computer shut down. So I went to reopen Unity hub, and open my project, except I could see all my assests and materials and all my files, except the scene wasn't there and it was all blank
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,963
    I'm sorry you've had this issue. Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.

    Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Generally setting Unity up (includes above .gitignore concepts):

    https://thoughtbot.com/blog/how-to-git-with-unity

    It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It's simply ridiculous not to back up.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards
     
  7. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    3,572
    IS the scene file not that or is it just not open in the editor? Did you even save the scene as a scene already? If not, then yes, your progress would be gone. When you start working on a scene, the first step should be saving the scene to a file and press CTRL+S as often as you see fit.
     
  8. funnyrickyboy

    funnyrickyboy

    Joined:
    Jul 22, 2022
    Posts:
    8
    Yes, I have been saving it, and my project was still there and all the assets I uploaded were also there. Except, I couln't see anything in the scene view.
     
  9. funnyrickyboy

    funnyrickyboy

    Joined:
    Jul 22, 2022
    Posts:
    8

    Okay, thank you for the tips!
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you open the scene file? Just checking, can you share a screenshot? I've heard of this issue a few times now.
     
  11. funnyrickyboy

    funnyrickyboy

    Joined:
    Jul 22, 2022
    Posts:
    8
    Okay. You can see that all my files and assets are there, except nothing is in the scene view.
     

    Attached Files:

  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    That's because you have the default blank SampleScene open. Did you save the scene previously? Hopefully into your Scenes folder.
     
  13. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,963
    Lost progress / project / work / stuff disappeared in Unity.

    This article is to help you when you have lost significant progress or work in your Unity project.

    It is designed to give you avenues of discovery and investigation.

    It is NOT a guarantee of restoring your lost work.

    To decide which parts are applicable to you, look for major headings.

    EVERYTHING IS GONE, YOU CANNOT OPEN THE PROJECT

    There isn't much to do except look for files that you know existed in the project before it went away.

    One common file to all Unity projects is named
    ProjectSettings.asset


    A typical Unity project will have at a minimum the following folders:

    Assets\
    ProjectSettings\
    Packages\


    Some possible causes of the entire project disappearing are:

    - you moved the project (or parent folder) somewhere else

    - you inadvertently deleted it (or a parent folder)

    - the project was never in the place you are currently looking and was somewhere else

    - your virus / malware solution has quarantined the entire project. This can happen because Unity produces executable code, and some overly-aggressive malware solutions will flag that as suspicious.

    EVERYTHING IS PRESENT BUT MY SCENE IS BLANK

    Make a full backup RIGHT NOW. Do not do ANYTHING else until you back it up 100%. Ideally copy that backup to another computer, or back it up into the cloud.

    If you can see all the files and folders of your project, make sure you are opening the scene file you were working in.

    Once you have opened the scene, look in the hierarchy window, select an object and move the mouse over the Scene window and press F to focus that object.

    Final notes:

    - NEVER use Dropbox or any file sync mechanism in Unity.
    - NEVER move files within your project, except by doing it within Unity
     
  14. funnyrickyboy

    funnyrickyboy

    Joined:
    Jul 22, 2022
    Posts:
    8
    OKay, thank you so much for your help.
     
  15. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Crikey Kurt, you must have substantial shares in Unity to post so much help. How is your own game btw?