Unity type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine'
The issue is that the required .csproj files (VSCode needs them to understand the available libraries) for the new package were not auto-generated when you installed the new package (it didn't happen for me either, maybe it is intentionally manual).
Go to Edit -> Preferences...
and then click on External Tools
. You need to tick the box to Generate .csproj files for:
Registry packages
(and any other ones you might want) and then click on Regenerate project files
.
That should generate whatever is needed for VSCode to recognize the new package - you shouldn't even need to restart it.
You need to install the package. Go to Windows / Package Manager. Search Input system and press install confirm to restart and replace the old input system.
Select your Input Action Asset, and turn on Generate C# Class from the inspector window and click on apply to generate a C# script file.
I had the same issue (Mac 10.15.17 with Unity 2019.3.151f1 personal) but the above didn't work 100% for me. Here was my solution:
First, I ensured that I installed the InputSystem package via the package manager. Window > Package Manager. Search for it and you should be able to install 1.0.2 which is the newest as of this post.
From there, I ensured that VS code was setup correctly. I when to Unity > Preferences > External Editor and ensured that VS code was the correct editor. I then selected Regenerate project files.
Lastly, on the script I was using, I included it in the top of the file like so:
using UnityEngine;
using UnityEngine.InputSystem;