0
\$\begingroup\$

I work with Unity and Visual Studio.

Almost every single keyword is underlined with the red curvy lines (representing error) in all scripts but the game works fine when I play it.

I tried unloading and reloading the solution and rebuilding and building the solution. But that solves my problem only to some extent. I tried restarting Visual Studio and my computer but that doesn't help.

The problem stated in this question is kind of similar to mine, but the answers do not seem to work with the UnityEngine namespace.

Earlier, while working on the same project I didn't get those errors for any reason. I am now getting these errors. I already have checked and installed everything needed.

\$\endgroup\$
2
  • \$\begingroup\$ If you open your Unity preferences and go to the External Tools section, what do you see selected as your code editor? \$\endgroup\$
    – DMGregory
    May 18, 2021 at 10:50
  • \$\begingroup\$ This related Q&A may also be useful to you \$\endgroup\$
    – DMGregory
    May 18, 2021 at 23:57

2 Answers 2

1
\$\begingroup\$

You probably didn't install the additional Unity tools for Visual Studio. Here's what you need to do to setup Visual Studio to work with Unity: https://docs.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/getting-started-with-visual-studio-tools-for-unity?pivots=windows

\$\endgroup\$
0
0
\$\begingroup\$

I solved the errors later by mistake, by doing this:

This is what I did -

  1. Made new scripts
  2. Copied the code of old scripts to the new ones
  3. Deleted the old scripts
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .