I was downloading a unity asset, when all of the sudden Unity just stopped! Couldn’t use Command + Q on it, couldn’t click anything, and I couldn’t even move the window on my desktop. So, I had to force quit unity. When I relaunched Unity, everything was fine and just how I left it, until I selected something in the Hierarchy and checked the inspector to make sure that all of my scripts have saved- and I saw that all of my scripts are broken!
Whenever I look at a script as a component in the inspector, all I see is a script component with the name (Script) and a warning message: “The associated script cannot be loaded. Please fix any compile errors and assign a valid script.” And whenever I select them in the project section and check the inspector, I get this: “No MonoBehaviour scripts in the file, or their names do not match the file name.”
The thing is, I went to check the scripts in visual studio- and they were just how I left them! No errors or anything.
I just started unity about a month ago, so I am very bad with a lot of things and I might not understand what you mean. Sorry if I don’t understand.
Unity is an octpus in a box which sometimes shoots ink. You will face crashes and unexpected behavior from time to time, but usually there are workarounds.
Try Refreshing your project (Assets → Refresh). If this doesn’t help, try reimport (Assets → Reimport All) and watch the progress bar (or take a break).
Halfway through the reimport process I just barely got a notification asking if I would like to enter safe mode. what should I do?
Oh wait, I fixed it!
I just opened safe mode and found out that I accidentally duplicated a file, which resulted in 3 errors that I guess messed up something in unity. I deleted the duplicate, exited safe mode, and everything works now! Thank you for your help ![]()
I would recommend that first thing, you immediately make a full project backup. And consider source control