Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Errors everywhere in every script, I am confused.

Discussion in 'Scripting' started by Neos_, Aug 15, 2020.

  1. Neos_

    Neos_

    Joined:
    Aug 23, 2017
    Posts:
    4
    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 \/ Capture.PNG
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,606
    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/q...isual-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.
     
    Neos_ and seejayjames like this.
  3. seejayjames

    seejayjames

    Joined:
    Jan 28, 2013
    Posts:
    692
    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.
     
    Neos_ likes this.
  4. Neos_

    Neos_

    Joined:
    Aug 23, 2017
    Posts:
    4
  5. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,094
    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
     
  6. seejayjames

    seejayjames

    Joined:
    Jan 28, 2013
    Posts:
    692

    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.
     
    Neos_ likes this.