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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

My unity project completely deleted.

Discussion in 'Editor & General Support' started by mrtkhosravi, Feb 2, 2018.

  1. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    I was working on my project as usual and then suddenly I realized the project became completely empty. WTF? I exited the editor and opened it again my project was not in the recent projects list. Is this F***ing intentional? I'm really mad and confused right now. Can somebody tell me if there is a circumstance which Unity takes the liberty to delete an entire project?
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    Did you happen to look in the folder where you left it?

    Why are you so upset if you deleted it? You can just pull from your version control.
     
  3. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    nope
    without knowing how/what you were doing we're not really going to be able to help you there...


    when less (understandably) mad, check out the available free source control solutions:
    https://unity3d.com/learn/tutorials/topics/cloud-build/creating-your-first-source-control-repository
    https://docs.unity3d.com/Manual/ExternalVersionControlSystemSupport.html

    etc.
     
  4. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    661
    Maybe you deleted it yourself or the harddrive it runs on is offline, but for sure Unity did not delete it.
     
    mrtkhosravi likes this.
  5. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Unfortunately I did not setup version control. Yes I checked in windows explorer. Everything inside the project folder is gone.

    If it was not unity then the situation will be much more relaxing. It's a very complex editor extension project so maybe it's a hidden bug of my code.

    Thanks for the links. I will absolutely 100% setup version control for my project.
     
  6. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    403
    Thank goodness you can copy from your backup.
     
    mrtkhosravi likes this.
  7. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Yeah I get it. The hard drive is fine. It's either my code or a virus doing it. thanks
     
  8. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Yes I have a backup from a week ago.
     
    LukeDawn likes this.
  9. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    403
    Lifesaver. Needed mine on more than one occasion lol.
     
    mrtkhosravi likes this.
  10. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    1. Start new project.
    2. Commit to version control.
    3. Work.
    4. Commit work.
     
    mrtkhosravi likes this.
  11. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    It could be in the trash right?
     
    mrtkhosravi likes this.
  12. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    661
    Fair point.

    At least lets be fair, what IF Unity deleted the project and this is a huge bug?
    I also miss a project of mine, while I can imagine that I deleted it as I got version control I am not 100% sure. But I also moved things around and potentially missed it somewhere...
     
    mrtkhosravi likes this.
  13. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    yes good to file a bug report
     
  14. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    How would you file this bug report? Can you imagine how dumb it would look?

    1. What happened?
    My project folder disappeared.

    2. What were you doing?
    Sleeping.

    3. How can we reproduce?
    I have no clue.

    4. Attach a project?
    There is no project.


    Considering that the OP doesn't even use VC I feel pretty safe in assuming that he accidentally deleted it himself and this isn't a Unity bug. I can't think of a single case where Unity has ever legitimately deleted the entire project folder. You could write a script to do it, and Unity runs that script, but it isn't going to do it out of the box.
     
    Ostwind and mrtkhosravi like this.
  15. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    No it isn't. It's permanently deleted.
     
  16. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    What made me suspicious is the fact that when I reopened unity the project was not in recent projects list. It's my only project and I always work on it. Maybe unity verifies the projects and removes them from the list if they are not valid Unity projects. In any case it is odd to me.
     
  17. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    Every time Unity loads it checks the project list for validity and removes invalid project buttons. (eg, if the project folder isn't there or isn't valid then it takes it out of your list)
     
    mrtkhosravi likes this.
  18. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    That explains it. BTW what version control program do you recommend?
     
  19. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    Bitbucket + Sourcetree.
     
    mrtkhosravi likes this.
  20. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    661
    I did not say to file a bug report, just proposed the idea of what if.
     
  21. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    It still could be a bug, even when there is no project to upload to show the bug
     
  22. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    OP Joined: Nov 9, 2014 - Still no version control 4 years later :D

    To answer your question about what version control, I recommend Unity collaborate because it is automatic and just works, which sounds like it is perfect for you. Of course no sympathy for your lost work. It's the same as doing sky diving and blaming others when you don't pack a backup chute.

    On a more serious note, projects usually will disappear and so will random files, when your hard drive begins to fail. And it will fail. Hard drives are unreliable for long term storage (both SSD and mechanical). The world's solution to this is redundancy.
     
  23. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    If your system has plenty of space, go through the recommended anti-malware tools on Bleeping Computer and do a really deep scan of your computer with every single one of them. Files don't normally just disappear like that.

    Just like the first rule of bungee cord failure: If at first you don't succeed, try a shorter cord.
     
  24. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Actually I have 12 years of programming experience and still don't use version control :p. TBH I don't trust tools provided to developers. They are buggy, not user friendly and of course stupid. I only trust microsoft and UT because their solutions work.

    Just look at this S***. I tried to install Sourcetree and what do I get?

    000316.png
    Now I have to contact sourcetree support to find out what the hell is going on. These so called softwares need a manual to just install the damn thing. Let the poor user install the program and then ask for additional info. Don't force the use of a ridiculous embedded browser for registration. Let the user uses his up to date google chrome!!!

    Think about it. This project took three years and is in final steps. I lost one week of work but on the other hand I was free of struggling with any tools like this for years. Now I remember why I didn't use source control in the first place:rolleyes:
     
  25. Nowlz

    Nowlz

    Joined:
    Nov 18, 2016
    Posts:
    55
    I'll second that. Even though it's called collaborate, it's still works a treat if your working alone and just need a quick and easy source control. I use WinMerge for comparisons.

    That said I still take weekly backups and store them on an external HD, as previously mentioned redundancy is key.
     
    Last edited: Feb 2, 2018
    theANMATOR2b likes this.
  26. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    It looks like you have a certificate root error on your system, because their certs expire in 2020 and shouldn't give that sort of error. It's starting to look more like your system has issues, possibly a MITM spyware issue. It wouldn't happen to be a Lenovo?
     
    mrtkhosravi likes this.
  27. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I used to have an automatic nightly back up but I stopped doing that due to Unity projects essentially slamming mechanical drives (far too many files - if anyone does this be sure to only back up the actual Assets folder) - and that kills mechanical drives for obvious reasons, especially if it's done over a few years. So I moved to weekly and this should be substantially less wear and tear.

    Cloud > all, obviously.
     
  28. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Yes It seems the system has problems. I'll check. No it's a desktop PC.
     
  29. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    Do you know what else would be stupid? Foolishly continuing with this policy now that you've seen what happens. Be glad you kept a backup at all. You could have lost far more than just one week of activity.

    Edit: Trust me it isn't like we haven't been there before. Hindsight tells me now that floppies were horrible for backups. :p
     
    Last edited: Feb 2, 2018
    Teila and mrtkhosravi like this.
  30. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    Lenovo make desktops too ;)
     
    mrtkhosravi likes this.
  31. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    That's a good point:D Clearly sourcetree is not a choice for me since it doesn't install. Is there a robust and proven VC with enough documentation or training which has integration with unity and visual studio? My project is an editor extension. Its solution has 6 visual studio projects other than the unity project. The unity project manages assets, folders and log files. It creates textures, Render textures and binary serialized files. If a VC can support this I'll definitely use it.
     
  32. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    I didn't know. No it's a custom assembled one with parts from different vendors.
     
  33. Master-Frog

    Master-Frog

    Joined:
    Jun 22, 2015
    Posts:
    2,302
    People hate hearing this, but I just drop a copy in Dropbox whenever I finish a feature and it's stable. It's unsophisticated, just like me!

    Ish happens.

    Just remember "I'm backing up backing up, cause my daddy taught me good!"

     
    theANMATOR2b and mrtkhosravi like this.
  34. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    What's your definition of "integration"?

    We don't hate hearing it. You're the entertainment after all. :p
     
    Last edited: Feb 2, 2018
  35. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    A context menu in Visual studio and unity to commit, update, ... so I could right click a file or folder and commit. Also some indicators can help a lot like color of a file in project view to show it is changed but not commited. As I said it's complex project and it's hard to remember what to do without tool assistance.
     
  36. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    Why would it be in visual studio? Vs has zero awareness of project assets that aren't scripts.
     
  37. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    What you're describing is automatically integrated into Windows Explorer when you install one of the Tortoise programs.

    https://tortoisegit.org/
    https://tortoisesvn.net/

    For Unity integration you'll need one of the assets from the store. This one has the most recent activity. It's $20.

    https://assetstore.unity.com/packages/tools/version-control/svn-tools-39131

    For Visual Studio integration you'll need one of the following extensions. Tortoise recommends the second one.

    https://ankhsvn.open.collab.net/
    https://www.visualsvn.com/visualsvn/

    Honestly though unless you absolutely need to be able to see the status of files from within these programs and be able to commit directly from Unity or Visual Studio, you can just rely on the Windows Explorer integration built into Tortoise. After all version control itself doesn't care what program the files came from. It just tracks the changes in them.

    Edit: Just realized I linked TortoiseGit and then proceeded to forget Git completely with the other links... :p
     
    Last edited: Feb 2, 2018
    mrtkhosravi likes this.
  38. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Because the majority of my development time is spent in VS and having and integration which lets you commit code or compare code with previous versions is really cool.
     
  39. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    I use VSCode with the GitLens extension. It's as integrated as things can get, with blame lines showing faintly next to the code, and popups to expand for detailed history of every code line if desired.
     
    mrtkhosravi likes this.
  40. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    This is an excellent answer. Thanks I'll use this.
     
  41. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    I think you missed the point - VS is only aware of the scripts while the version control is going to cover all files.
     
    mrtkhosravi likes this.
  42. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Even so VC softwares provide plugins in IDEs. These plugins act as a svn or git client. If an integration is present you should be able to commit or update the scripts. Other resources could be commited in Unity or standalone VC client or as Ryiah said even in windows explorer. There is nothing wrong with having multiple VC clients for the same resource.