It's not recognizing InputAction or UnityEngine.InputSystem

The course is number 1676087 Unity 3rd Person Combat & Traversal

In the script “InputReader”
public void OnJump(InputAction.CallbackContext context) the InputAction is underlined in the script. I added UnityEngine.InputSystem but it says that InputSystem is not part of UnityEngine.
Any suggestions would be appreciated.
Thanks Ray:

When you save the file and go back into Unity, is it throwing the same error in the console?

If it’s not, then Visual Studio Code isn’t picking up the change in the input system. In Unity, go to Preferences|External Tools. Make sure that Visual Studio Code is the selected external editor and Refresh the project files. (If you are using a different editor, like Community or JetBrains Rider, make sure that that is your selected external editor).
Some have reported that the latest version of the Visual Studio Code plugin in the Package manager isn’t playing well with the current version of Visual Studio Code. You can try rolling back to the next previous version of Visual Studio Code plugin in the package manager by clicking on the small drop down button on the Visual Studio Code plugin entry and selecting a prior verison. If you do this, you’ll need to regenerate the project files again.

If it’s also throwing the error in Unity, then you may need to go into the Project Settings and scroll down to the Input section and make sure that it’s set to use the new input system or the hybrid approach and restart Unity. See the lecture on setup for exact instructions on this.

Privacy & Terms