Errors everywhere in every script, I am confused.

So I was just doing my own thing about to edit a script when errors appeared all over the place. My game still runs fine with these errors and unity does not recognize these errors. I have never seen something like this before and i’m not sure what I did haha

This is just an example of what is happening in all of my scripts /

This can have different causes, but if it worked before it’s most likely some temp file got corrupted. Deleting that file such that it gets regenerated should fix the problem. Sadly my further expertise on this is limited, but you should find plenty of similar topics when googling for unity + visual studio + red underlines. Such as:
https://galasoft.ch/posts/2014/01/quick-tip-what-to-do-when-visual-studio-freaks-out-and-everything-is-red
https://stackoverflow.com/questions/21098333/visual-studio-compiles-fine-but-still-shows-red-lines

If it never worked for you make sure VS is set as editor in Unity.
I believe vice versa there was also a VS option for Unity.

2 Likes

I’ve had this happen. It’s definitely a VS problem. Haven’t seen it lately, maybe the newer versions handle things better. I think restarting VS has fixed it before, but can’t recall exactly, it’s been awhile. Annoying for sure.

1 Like

@Yoreki @seejayjames
I found a solution that worked for me in this thread squiggly red lines in VS2017

What ended up fixing it was going into my unity project file and deleting the library file then re-opening my project. This is odd because i thought it was a problem with visual studio like you said but I guess not.

Thanks for the replies!

Make sure that Visual Studio is appointed as External Tool.
What you could try is clicking the button regenerate CSproj files
close and re-open VS

On that note, if you ever need to make a zip of your Unity project, delete the Library folder first (it will be regenerated). This folder is often many times larger than the rest of the project, so it saves tons of time and disk space.

1 Like