Did I just lose an entire weekend of work?

I exported a project from Unity as a package on another computer, then transferred it and opened the package at home. Everything seemed to be in order, and I started fiddling with the project. I forgot that I had transferred a package instead of the whole folder, and after two days of work, I closed Unity. I’d been Using CTRL-S to save the scene as I worked on it, and, of course, I also saved changes to my scripts which were opened in Mono.

Everything - and I do mean everything - seems to have disappeared into the ether. I’ve searched my entire system, and all I can find are old versions of the project. It seems that the scripts, at least, should have been saved somewhere on disc, since I was constantly editing them in Mono and reloading them in Unity. Is there a temp folder where Unity might have saved the data under weird filenames or something? I can’t believe all those changes were simply written into vapor.

that same issue happened to me yesterday lol. in my case i was working on a scene and after closing unity and coming back to it the whole scene dissapear and yes normally people would think about saving in my case i been working with this same scene so oviously it’s been saved if i been working on it for more than one day lol

Yeah, this is not good. It looks like I’ve lost hundreds of lines of code, and a handful of GameObjects, consisting of almost two-hundred individual frames. The graphics I have backed up, but I didn’t expect Unity to randomly wipe out my script files, they only existed inside the project.

I can’t figure out what happened. I got no warnings, everything seemed to save fine from the IDE, MonoDevelop loaded, edited, and saved the scripts, just fine. Unity reloaded the scripts properly after I saved them. Where the hell did they go? Are they in my recycle bin under some crazy DE$5~1 type filenames? Having to start over would be very discouraging.

Well to open a package you must have opened a previous or new Unity project to import it. Importing it will place all the content from that package into the project folder on disk, so your data must be somewhere on your machine. So the question is what project did you import the package into? Did you create a new project, in which case have you checked for a default Unity project name in the default unity folder (e.g. my documents). Otherwise go through all your unity projects, loading them into unity if necessary looking for the imported package. It must be somewhere.

If you haven’t opened many Unity projects in the meantime (and didn’t have multiple instances of Unity open) you should be able to use the ‘Project wizard’ to locate the most recent projects.

Failing that if there is the possibility that you deleted the imported package from the project somehow it should be in the recycle bin. Though i’d expect it to be under an obvious name.

I have to say I don’t see how Unity could wipe out an entire project or multiple script files. Sure perhaps a single file might get corrupted (script or scene) but not an entire projects worth. Keep looking your data must still be there somewhere.

I followed that same logic: it has to be SOMEWHERE. So far, I cannot find it. The original package is sill available. Because I made a few backups when copying the project back and forth, I do find two or three versions of “MyScript.js” when I search my drives, but they are all older versions, the same goes for “MyScene.”

The first thing I did when I closed and re-opened Unity after working on the project this weekend, was to go to the “recent projects” dialog and start opening the last few projects. No dice. Believe me, I realize how bizarre this sounds, and I’m also thinking “Well, it shouldn’t do that…” but those files are gone.

In the meantime, I re-opened the original package. Could that have overwritten all my changed files without so much as a warning? If so, that’s really poorly implemented. However, I couldn’t find the files before I tried re-opening the package, anyway, so…

I have been over the drives thoroughly, if the files exist, they do not exist under their real names. For some reason, I have about three billion items in my recycle bin, but I will look through there, again. I do not expect success.

Edit: Yeah, whether or not it makes sense, those files are GONE. All I can think of is that Unity re-opened the package automatically when I re-opened Unity and overwrote everything without asking, but that would be ridiculous behavior. I can’t imagine Unity would behave that way, but something is wrong, because I 100% promise you that I did not go around deleting project folders in the thirty seconds between when I closed Unity and when I decided to re-open the project.

Well I was hoping you’d just ‘missed’ something, hence going through all the options I could think of. Unfortunately it sounds like you’ve been through the same processes and still ended up with nothing. So it doesn’t look hopeful.

Hmm, this might be a possibility, if you had updated the script and scene file, then on the import package screen it may have highlighted those files as being ‘new’ in the package since they would now have different timestamps, even though your edited script/scene is actually newer than those in the package. I think its something I noticed in the past, but never had the time to investigate. I would be very surprised though, such an oversight by UT, I would expect a global warning and for old files to be highlighted as being ‘old’, just like they do with ‘new’.

However whilst it may ( I would prefer to test exactly what happens when you import a package which has older versions of assets before stating anything as fact) be possible that you could have overwritten your work, it would have happened after you thought you’d lost it, so you would had to have missed the fact that the project you had opened had your latest work in it. Which in itself would be a bit odd as you say.

Alas I fear in this case your work may be gone, for what reason we may never know. It sounds like you are quite analytical, so have been through the common-sense processes, back-tracking, checking etc with no joy.

The only other suggestion is to check out monodevelop, I know when it does crash it tends to have auto-back up copies of the files it has opened. I assume it must have a folder somewhere that stores these back ups, perhaps you might find your script there.

I re-opened Unity almost immediately after closing it. Unity, of course, automatically re-opened the project. I think I did get a warning about the scene needing to be reloaded, or something like that, but nothing else. After Unity re-opened the project, I immediately noticed that things were wrong.

Edit: I think the warning was “This scene has been modified outside of Unity. Reload it?” or something along those lines, nothing to make me think Unity was going to just run roughshod over my existing files.

Yeah, I couldn’t find anything under Mono, either. I was hoping it might have an automatic .BAK system, but I didn’t find anything of the sort. This is painful. Really, if Unity is going to overwrite existing files with the files from a package, you should at least get some kind of confirmation dialog, especially if Unity automatically re-opens packages and decompresses them to your project folder (I don’t know if that happened, just speculating.)

I just ran a bunch of tests, and this is exactly what is going on. If you open a package, it simply wipes out the files in the destination folder without so much as a peep. Really, that is obscene. How is that acceptable behavior? I’m seriously considering spending $4,500 on a piece of software that I now find out will destroy my work simply by starting up? Yes, in a production environment, I would have backups, but this is still ridiculous.

Wow. Not so much as an “Are you sure you want to overwrite all these files?”

Well in fairness you do have to instigate importing a package. I never realised until your post you could actually double click on one to load up unity and I would never describe using a package as ‘opening’ it, but always as content to be imported into the current project.

Of course none of this excuses the lack of warnings that it might be over-writing more up-to-date files. If from your testing this is defiantly happen, then you should log a bug, as it must be an over-sight on Unity’s part.

You’re correct that you have to instigate opening a package, but, as you also note, that does not excuse a lack of warnings before overwriting files. I’d say that goes double considering that it isn’t exactly hard to misclick. I don’t even get the import dialog when this happens.

It turns out it’s not based on file location, at least it isn’t just file location. Unity automatically re-opens the last project you had open. So, I double-click the package, Unity loads the last project I had open, then imports the package files, automatically, and overwrites everything* in the project that Unity opened when it started.

  • By “everything,” I mean matching files.

Woah, you’re right, at least in U4.0 as that’s what opens for me when double clicking a package.

I had assumed you still got the ‘import browser’ where you could select which assets to import or even cancel out of the import altogether. However as you say it just automatically imports the package over-writing any existing assets in the project without so much as a warning. This is definitely not good and I guess pretty much explains what must have happened to your project.

I’ve reported it as a bug, hopefully Unity can address it in some way or other.

As for Unity automatically opening the last project, I’ve always hated that, so in the preferences i’ve turned on the project wizard. This lets you choose which previous project to load instead. It doesn’t necessarily solve your problem, but at least it would give you the option of quitting out of Unity before it automatically imported the package, assuming of course you realised you’d accidentally double clicked a package.

Unity sucks with regards to acting like an IDE. I just lost 4 days work because it overwrote all my scripts from an old load. Transferring work between two computers is nearly impossible without fudge the registry. Does anyone have a clean way to move files between computers? My recent properties have two identical projects and both load the wrong thing.

If you would use a Source Code Control System ,non of this would bother you.
Its makes syncing various version of an project to a server save and easy.

by the way: using packages to transfer projects is the wrong way, because its does not transfer any project specific settings.

Commit/push Assets and ProjectSettings folders to git/mercurial/SVN or your VCS of choice. Clone/pull/checkout on the other PC. That’s about it.

really? Ive zipped up the folder my project was in and shared it and everything worked perfectly for the other people opening the project on their PC … or am I missing something here? I understand source control is the professional way to do it and have used it before , im just pointing out that a zip of the project directory seems to work fine as well.

Sure, it works. However, that is pretty slow if you need to change the project a lot and need to change it constantly :).

1 Like