2
\$\begingroup\$

I'm attempting to learn Unity's new input system, but when I try to add using UnityEngine.InputSystem; to my code it gets a red squiggly line under it. It doesn't cause any compiler errors, but it's very annoying. How do I get Visual Studio to recognize this so Intellisense will work again?

\$\endgroup\$
4
  • \$\begingroup\$ Did you install the package for the new input system through the unity package manager? Did you restart Unity and Visual Studio afterwards? \$\endgroup\$ – Philipp Apr 16 at 7:44
  • \$\begingroup\$ yes I did both of those. \$\endgroup\$ – Millard Apr 16 at 10:13
  • \$\begingroup\$ Is the correct Visual Studio version selected in your "External Tools" preferences in Unity? You may also want to try hitting the "Regenerate project files" button in Unity to see if that helps. \$\endgroup\$ – DMGregory Apr 16 at 11:36
  • \$\begingroup\$ Where is the Regenerate project files button located? I can't find it on Google. \$\endgroup\$ – Millard Apr 16 at 18:18
4
\$\begingroup\$

I found the answer online! I had to go to the editor preferences (Edit -> Preferences) and under External Tools, there's a section with checkboxes under "Generate .csproj files for:." All I had to do was check "Registry Packages," click Regenerate project files, and it worked! Thanks to everyone who tried to help, and to DMGregory for his comment on generating project files. I hope this question can help someone else.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.