Several scripts wiped upon changing machines

I use an offboard SSD(usb) to hold the files I use on my laptop so I can bring them quickly onto my PC when I want to. I’ve ran into a problem once, where I closed the laptop, which puts it into sleep, while Unity was still running. Later in the day I disconnected the SSD and connected it to my PC to find the scripts I had open in monodevelop/unity missing 90% of their data. I assumed this was because I went into sleep mode with Unity still open, though that really doesn’t make sense anyway.

So I went on using the SSD being careful to always close Unity when I go into sleep mode. Months have passed without problems. Today I did the same, but just now tried to open the project on my PC and it reimported the whole project, reset my window layout, and wiped the three scripts I had open leaving one with 41 lines of blank code.

If I am to expect this to ever happen again I never want to use my SSD ever again. Probably a good 500-600 lines of code I built here and there over the past two weeks just wiped without question. I make backups about every two weeks, but not every day.

I don’t understand why the data would be lost… windows scan found no errors on it…
Has anyone else experienced this? Can anyone explain this?

That does sound strange, many of us use SSD and I have never heard of that before. I would strongly suggest using some source control, its very simple to set-up and perfectly fine to use even if you are the only person developing on the project.
It will also make it easier to transfer between your PC and laptop if you use something like bitbucket or host a repository on your SSD. Git is a popular choice although there are other alternatives.
If you are able to recreate the issue or capture some error logs or messages then feel free to submit a bug although it does sound like the issue is related to your SSD and/or setup.

I can only imagine that it’s related to a bad sector cropping up on the SSD and then unity trying to auto-compensate for that, or maybe even Win10, it likes to tell me about 1% of what it’s doing… Serious bummer though =[

I’ll look into the concept of source control, I don’t even know that terminology. Or at least some sort of auto-save for my scripts. Cry myself to sleep for now, haha, just kidding.

add: I closed unity and mono once. then reopened mono. now it’s not even showing the three files in explorer, and the scripts are colored red in the hierarchy of mono as missing -_-

Unlikely that it is a problem with the drive. Make sure to save and quit unity (or at least the project).before disconnecting the drive. Unity stores many support files in the project, (meta, library, etc). Those files aren’t saved instantly. Disconnecting the drive with the project open will eventually cause a problem.

Unity is very fragile with regards to its environment. It is a good idea to quit unity any time you are altering your environment. Switching monitors, adding/removing displays, switching networks, turning lights on and off in another room, all can cause crashes/damage to your project.

Adding removing devices that your project is on would also be one.

I was kind of tired and upset last night, but I think you are right. It was working fine for months since I started being careful to close Unity first. Perhaps I closed the the lid too fast while Unity was still finalizing data in background processes. I did scan the SSD after I noticed the problem and Windows didn’t find and bad sectors so… I will still look into some form of a secondary backup process though for safety.

I tried using dropbox and somethings in the past, even burning a 2G usb out copying a whole project across HDDs with it twice a day for several months. Something that would just watch the scripts folder would be nice though…