I just finished off a relatively simple game object (just the one day’s work) and was tidying up my project folder a bit when I realised I’d been silly and the folder that contained the meshes, prefab, textures, scripts… everything… was in the wrong place. So I dragged and dropped it to where it should be and got an error saying one of the files was in use. Oops, I still had all the textures open in photoshop… closed that down and dragged and dropped again… boom, all the files from that folder are gone, and aren’t in the folder they were being moved to… just completely gone
Trying a deep scan of the drive with Recova just now since the normal scan didn’t show any of the files I actually wanted that had disappeared, just a couple of .meta files and the prefab strangely… so fingers crossed for that
I’m unsure if this is a bug or just random unluckiness but yeah, I guess I will make sure I have a backup/commit from now on before I try and move any folders around… and maybe stop using the assets folder as my only folder for saving psd files I am working on for the game, lol… it’s just so handy seeing the game update changes without having to copy and paste the psds
Has anyone else noticed something like this, or am I being silly in the first place dragging folders around within unity ?.
Update: I managed to recover the files, phew :)… they were missing a folder record which is why limiting the recovery search to just the assets folder wasn’t working… learn something new every day.
Unsure if it’s related, but when I tried to rename some textures I imported for UI, they also disappeared from Unity entirely. Upon restarting the engine, I got some error about the UnityEngine.UI and a guidmapper, which required deleting the library folder and re-importing assets to fix.
I filed a bug report on that and it was confirmed as a bug. Again, not sure if it’s related to your case or not.
So did you move the folders in Unity or in Explorer/Finder? There are some things you should always do in one, and some things you should always do in the other.
Sorry if I didn’t make that clear, I moved the folder using the project tab within unity… I would be interested in knowing the proper way of doing things for both though, since I can’t seem to find much info googling around.
Unity documentation just says to do all your file naming and moving within unity to ensure the meta files update properly. So you did it correctly. However, I do think that Unity’s stability in 5.0 plummeted drastically. I was working quickly and accidentally clicked on my standard assets folder just long enough to drag it down a couple levels. I clicked and released fast enough though that I barely had time to see what happened. So it tried to move a parent directory into a child directory. I have 3 monitors… the error that exploded spanned all 3. 5700 pixels worth of error… Turns out it created a recursive reference that neither unity nor windows knows how to handle. So I have this directory now that I can’t get rid of. And I wasn’t able to open the project. I had to reclone from my repo (but lost all my current work) and create a new project to keep working. That directory still exists. I’ve yet to figure out how to get rid of it. I can delete it and then a soon as I move my mouse or click somewhere the directory reappears. All because I accidentally clicked and dragged a folder down a few places. This kind of thing should not be possibru.
All that to say… You probably didn’t do anything wrong. 5.0 needs some more polish. I’m discovering a lot of odd behaviour with the editor that’s really making things difficult for me.
Ouch jtsmith, that kind of thing should indeed be impossible… something else to watch out for !. It sounds a bit familiar too, not the recursion part but going to click on something in the project tab and accidentally moving it, or a file / folder I wasn’t even intending to click on.
The folder you are left with sounds like it will be slightly longer than windows pathetic 260character limit… I have done this a few times by accident over the years and was just googling around to refresh my memory on how to fix it (think I normally rename each folder to 1 character till the entire thing is short enough to delete) and found a small open source app called Deep Remove hosed on codeplex… Might be worth a go ?.. I haven’t tried it, and it has few mentions / reviews it seems… uploaded the installer to virus total and it came out clean though
Ya I’m not too concerned with it. It’s just one folder among many. Thanks for the idea though. I’ll look into that some time and see if it takes care of it, though likely some cli foo might do the trick.
Sounds like a UT5 bug to me. I’ve had it happen recently too, however in my case it had occurred during a folder rename. I’m certain none of the files within that folder had been in external use, yet that was the message I also received (possibly locked by UT itself?). The entire contents of my folder had vanished. Nothing in my recycle bin - nada! Fortunately I back-up, yet I still lost my most recent work.
I think monodevelop might also count as an external app ?.. though I usually forget it’s running and it seems to figure out what I’m doing… at least it did in 4, hmm… I will need to keep a closer eye on that in the future as well.
If this happens to anyone else, the free app I used to get the files back in the end was Puran File Recovery. I think Recova also would have worked if I wasn’t limiting the search to just my assets folder since the files had lost their folder record (I guess why they disappeared in the first place?)… I tried recreating the subfolders etc with the recovered meta files but didn’t have much luck, the actual files themselves were thankfully fine
Like @jtsmith1287 says, moving it in the Project view maintains the project metadata, so it’s definitely the correct way to do what you wanted, and is almost always what you want to do.
You do it in Explorer/Finder if you deliberately don’t want to update the metadata. For instance, if you want to replace one file with another in some cases that’s easier in Explorer/Finder. Unity will see that as a file update just like any other, re-load the appropriate resource, and any references to the original will now point at the new. If you’d just dragged the new file into the Project view Unity would interpret it as a new resource (because that’s what it is) and you’d have to manually re-assign any references from the old to the new.
That’s why I’m committing what I’ve done after each workday, no matter of % of completion of said work. If anything bad happen, I’d lose at worst day worth of work.
Doing a commit every day is pretty standard. And If you’re in team, you better do a commit once every day, but with a code review from someone else in your team.
As a general rule, you shouldn’t rely on a manual action for data saving. I use crashplan (other solution exist) that save my work every two hours automatically.
I wish you good luck for your data recovery !
heh, I just came across this as well. Having made a commit (and a rar backup) and with a folder needing renamed I figured I’d do a little test. It seems that closing the textures within photoshop isn’t enough to stop the in use error from from popping up when I tried to rename the textures folder so I quit photoshop completely and hit try again, files gone and the errors you mentioned after restarting unity.
It gave me a good excuse to have my first go at actually getting data back from my commits… have been curious about that