Home > database >  Unity/C# - Compiler Errors ONLY in VSCode, not Unity Editor or Visual Studio
Unity/C# - Compiler Errors ONLY in VSCode, not Unity Editor or Visual Studio

Time:10-04

When trying to reference a class from a Unity package (specifically InputSystem), VSCode will give me the errors The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?) [Assembly-CSharp], even though Unity builds and runs just fine with no complaints, and generating the project files for Visual Studio work properly.

This started when trying to move to VSCode from Visual Studio as my main editor, so something in that process likely broke them. I have tried a bunch of different things - deleting and regenerating the .csproj and .sln files, uninstalling, reinstalling, and updating the package, even deleting the whole repo and re-cloning but nothing has fixed the issue.

CodePudding user response:

This is definetely a unity/ide integration problem. Try following this official guide to setup VSC Unity support.

CodePudding user response:

Did you follow this tutorial instructions for using vs code with unity? Because some things need to be installed in order for you to use vs code with unity.

  • Related