In my Unity project, I have created this television that I imported from a 3ds file. When ever I go really close to it, Unity crashes (I suspect that it is because there was an error with the colliders)It has happened once or twice, and my project was okay. Then I did it once more on accident and the next time I opened up Unity, none of the scripts worked except for FPSWalker. My robots are not responding, the weapons are not shooting, but the physics are fine. I tried removing the scripts and then adding them again, but a message popped up saying that the scripts cant be added because it has not finished compilation yet. I opened up the scripts in the script editor, but did not find anything wrong. I even tried reimporting all assets, but that did not help. What could I do to get my project working again? (next time I am going to put a box collider around the TV) ![]()
Ya that sounds really strange, the only time that happened to me, was when I was editing a script and got it wrong,(noob coder). I tried to apply the script and Unity said, “you cannot add the script until it finished compiling”.( That of course never happened). I closed Unity and started it up again, and all my scripts were messed, and my project was a write-off. Now when I get that message, I make sure to delete the offending script before closing Unity. I am also in the habit of saving a backup copy of my project, just in case!
‘Not done compiling’ is usually just a syntax error in your code. The most common is when you don’t name a class and file the same in C#. 5 min ago I had this happen because I was using a double for something instead of a float. If you are using Visual C# it will probably help you out with the error.
Regarding project corruption…
I stumbled upon something that might help while testing out SVN workflows.
If you ever open a project and things are missing, connections messed up, etc…
-
Make sure unity is closed.
-
Go in to the library folder in your project structure and deleted ALL the sub directories:
- cache
- metadata
- ScriptAssemblies
In my experience, these files don’t store anything which is not regenerated by Unity on import. Nothing seems to get lost when you delete these files.
-
If there are any Backup folders in the project root folder, delete these too. I’m not sure you need to, but I clean them up just to be sure.
-
Open Unity and it will tell you it has to re-import the project. Click “ok”. This will rebuild all the files you deleted.
I have fixed two strange after-crash file-open issues by doing this and got all my stuff back.
Originally, I started looking in to this because I read comments by a guy who used SVN and ran in to cache corruption issues. I thought this sounded strange because cached stuff is not usually used for saving data. Sometimes we store simulation cashes during VFX work, but it’s usually just for storing temporary data to make things run faster. So, I made a copy of my project and deleted them all to see what would happen…nothing…just re-import once and they come back.
I no longer keep these folders in SVN at all. We don’t check them in.
I hope this helps. Good luck.
I downloaded a unitypackage and it dumped loads of crap into the root of my project, i moved it into a folder and 90% of the images now show up as missing when they are not.
I deleted the stuff i imported and its all still broken. im wondering if by importing a package i imported a prefab that referenced a generic script and by deleting that i took out half of the scripts in my project.
try goin to build settings and switching platforms and then switching back.
rsx you saved my life! I have been working on my game for years and when my files got corrupted and unity kept crashing I was on the verge of tears. Deleting the files in the library fixed everything