Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Updated Unity. Now C# code is giving me loads of false negatives

Discussion in 'Scripting' started by Graystripe2000, Jul 24, 2021.

  1. Graystripe2000

    Graystripe2000

    Joined:
    Apr 9, 2021
    Posts:
    27
    I updated unity and then went back in my project. Now my C# code has all sort of red lines under with the error saying Bool, int, float whatever can’t be defined it imported, “Vector 2 cannot be found. Are you missing a directory”, etc. yet the code works just fine. Any idea how to fix this? This happened when I transferred my project to a newer version. I’m using Visual Studio 2019, BTW.
     
    Last edited: Jul 24, 2021
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    This may help you with intellisense and possibly other Visual Studio integration problems:

    Sometimes the fix is as simple as doing Assets -> Open C# Project from Unity. Other times it requires more.

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
    Ryiah likes this.
  3. Graystripe2000

    Graystripe2000

    Joined:
    Apr 9, 2021
    Posts:
    27
    First one fixed it. Thanks!
     
    Kurt-Dekker likes this.