Can't get unity to recognize InputSystem

No matter what I do, I keep getting the error:
"The type or namespace ‘InputSystem’ does not exist in the namespace ‘UnityEngine’.

To summarize what I’ve already tried:

  • Installed the package
  • Set ‘Active Input Handling’ to the new system.
  • Regenerated project files (with and without Registry packages checked)
  • Toyed around in the Packages/Manifest.json

I’ve tried this on three separate versions of unity on two different computers.
I have gotten this to work in the past but nothing I’ve tried has worked this time.

If I manually add a reference to the InputSystem dll to my project visual studio stops complaining.
But the error does not go away in Unity and after closing and reopening everything the references are gone from visual studio. I assume that whatever I’ve done Unity is still not tracking those references so they get wiped out the next time project files are recreated.

I’ve scrolled through the entirety of several posts on redit, stack exchange and dev.tv but nothing so far has resolved the issue.

Hi,

Welcome to our community! :slight_smile:

There might be a problem with your script editor (Visual Studio Code?). Please go to Edit > Preferences > External Tools and click “Regenerate project files”.

Did this fix it?


See also:

1 Like

No I tried it again just in case, but I’ve tried regenerating project files before.
I’m using Visual Studio Community 2022.

Turned out it was a problem with our assembly defenition, we seperated out our test code into seperate projects and I guess we started using custom assembly definitions at that point. We just had to add the reference “Unity.InputSystem” to our .asmdef file.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms