Unity API Update ruined all my scripts

Hey! So I was trying to make a pause menu and copied this script into my game and I needed to run a API update. So I updated and it made virtually all my scripts red so I think it installed a older update or something. Sadly, this is the one time I didnt make a backup and my last one was ages ago and would loose all my things that I have spent weeks on. Is there any way to fix this?

What do you mean made your scripts red? Show us something to go off of. However, I will say you can probably try deleting your library and it will force a reimport. That’s really the best I can offer without knowing more as I don’t know what it did to your project.

Manually fix each error one at a time.

Take this as a life lesson and use version control.

1 Like

What happens is it basically shows everything as unimported and the code is all red. I will attach a screenshot.

3069023--230753--Screen Shot 2017-05-14 at 5.18.44 pm.png

That looks a lot more like a broken installation.
Can you make a new script that even works ? Even Monobehaviour was red. :>

Definitely try deleting the library folder. I find it tends to mess things up between Unity versions, or even different PCs.

Then you can try force a reimport all, see if that helps.

Good tip. Never had that problem, yet, myself… :slight_smile:

I tried deleting Library and Reinstalling. That didnt work everything is still red ):

This happened to a coworker once and the way we fixed it was to reconnect monodevelop. Since he’s on a mac and has yet to try out Visual studios for mac, he’s still using mono for his coding. We tried several things before hand before this.

So go to Edit ->Preferences → External tools
External Script editor will probably show mono (his did), I think he just re-selected mono in the drop down and then that fixed things for him.

Also, I do suggest if you can use Visual Studios, do make the switch. I haven’t had an issue with it yet, but monodevelop was always buggy for me. just a personal note

the image simply looks like a broken csproj file, happens sometimes when Unity and MonoDevelop try to access a file at the same time. I got this the other day.

make sure all your scripts are saved, then close Monodevelop.

go to your project folder and delete the Assembly-CSharp.csproj file. you might need to delete the editor.csproj and firstpass.csproj if those have issues as well (though I’ve never had issues with the firstpass).

go into unity, right-click in the project panel and choose “Open C# project”. Unity should regenerate the csproj files, fixing your references for you again. Monodevelop won’t remember which files you had open previously (since that state is stored in the csproj)

2 Likes

Another good tip. cool lol

I tried both of your opinions and neither of them worked everything is still red ): PS I will change to visual studos after possibley :wink:

Just bumping because I need a answer soon

are there compile errors in unity’s console or just in monodevelop?

Just in monodevelop but it has caused my building placement script to have errors and no longer work

Honestly, I’m out of ideas. You can try to update one of your old backups, if that doesn’t take to long. Good thing is you can still use the current project to quickly reference what you’ve done since your backup.
You can try switching to Visual Studios and see if that helps.
You could try to export the entire project as an asset package and then create a new project and bring the asset package into it.

All the suggestions I’ve seen are things that will usually fix it. In reality, if this is important to get done, you might just have to try to bring up an old backup instead of chasing solutions that might not fix things for you.

Could be some class name conflict.
Check if your copied script has this ‘Button’ class

what is the error?

Sadly I have had no choice but to restore the backup. I have lost lots of progress but I think I will catch up soon. Thanks everyone for their help

Hi @Skyfall106

Sorry to hear the APIUpdater caused troubles to you. I’ve only found this thread today.

Do you happen to have a backup of your project when you get this problem? If so, I am interested in trying to understand what happened and fix it so it will not cause troubles for others.

Best

Adriano