Uh.... why did Unity delete all of my scripts, scenes, etc?

Hi, I just started learning Unity. Seems pretty easy to work with… except…

Last night, I closed down my work for the day. Opened up my project today and nothing exists from the day before except a folder I manually created within the project to house my sprites. Seems like everything in the “Assets” folder got wiped. Why did that happen? There was no crash. I was saving often. It even deleted files that I originally was able to reopen from the day before.

I’m on a mac. The one suspicion I have about last night compared to the night before (no problems opening the project yesterday) was that I tried creating multiple scenes and used the scene manager to load them. During this period, I also removed the sample scene from the build settings. Everything was working fine so I don’t think that I corrupted anything, unless Unity requires a specific order of operations to ensure that everything persists?

When trying to open recent scenes, it looks like it’s TRYING to find something that once existed, because it’s showing some broken path output in the menu dropdown. So there is some meta data somewhere that at least let’s me know my work wasn’t all just a vivid fever dream:

Could it be an issue with the mac version? Is it because of Unity Hub? Is it because I hadn’t set up version control at all and left it as “apple file merge”? I see a lot of questions about this on the forums but haven’t really seen a good explanation as to what is causing people to lose all of their files. Did Unity try to back up to a previous version when I opened the project? Why didn’t that happen the first day I reopened the project? Could I have done something differently to prevent the files from being lost?

Before anybody tells me to use version control, this was a test project just to see if I like the engine. I use version control on a daily basis and yes, I know it’s good advice. That being said, version control won’t prevent this problem from occurring. It just mitigates the damage when/if this problem does occur. If I have to reclone my repo or pull down assets from some external source every other day because Unity randomly decides it’s time to delete everything in my project, then I’m pretty sure I’ll just use something else. I’m only posting this to learn exactly why something like this might happen and how to avoid it in the future.

It wasn’t a great project by any means, but it was fun to work on and I’m sad that I lost it all. I did manage to export an app before this happened so at least I can play that and reminisce on all the work that got lost lol. Oh that reminds me, the folder that housed the built application was also manually created by myself. I’d imagine that is why it didn’t get wiped. Hmmm…

Thanks for taking the time to read this. Any advice/experience/suggestions as to possible causes would be much appreciated.

Who knows?

It could be almost anything

  • a bug in Unity

  • some script or process on your computer, like a third party file syncing tool (google drive, rSync, some mac time machine utility)

  • a stray cosmic ray that borked something in a program your computer was running or your SSD

  • You accidentally fat-fingered something when saving something or moving files around your computer and accidentally deleted or moved or overwrote something

  • Your cat jumped on your desk and pressed some buttons while you weren’t looking

If there was some detailed audit log of the exact actions you took or something we could find out. Absent that, and with only a vague description here, we can only throw our hands up and shrug.

Indeed. In fact version control (or at least this aspect of version control) and the concept of “backing up” your work in the first place is designed specifically to mitigate against the unexpected. Even if it was a bug in Unity, and Unity did fix that bug, it wouldn’t get rid of the need for version control or backups, because you never know when something unexpected is going to happen.

1 Like

Although I appreciate shruggies as much as anybody else, I was kind of hoping that there was a known issue surrounding one of the less vague possibilities that I suggested, such as using apple file merge, or people using unity hub on a mac etc… I can at least rule out 3rd party file syncing tools, accidental deletion of the files, or a cat attack. Cosmic rays are still pretty sus. I don’t think I live near any irradiated trains that may cause some bits to flip as they pass by.

This is a really good idea! Do you happen to know if Unity keeps a log of when it performs certain file system actions, such as cleanup?

Thanks for your response. I appreciate the humor and the thoughts. :slight_smile:

This just happened to me, no logs that i could find, nothing.

Just happened to me as well, can find many other people experienced this exact issue. This is completely ridiculous. Can we get a statement on this?

Now it’s 2 times in the past 3 months on different computers. This is very bad.

In which folders are you creating these projects in?