Home > database >  I've got an error, but I don't even know where to start
I've got an error, but I don't even know where to start

Time:10-20

I'm using unity, and this error is coming up:

InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings. PlayerController.RetrieveMoveInput () (at Assets/Scripts/Controllers/PlayerController.cs:13) Move.Update () (at Assets/Scripts/Capabilities/Move.cs:30)

It says this error comes up 999 times, and I don't even know what its talking about. I'll post my scripts, and I'll post a screenshot including my console and all my objects in my scene:

enter image description here

Scripts: file:///Users/elliotsmyth/help me/Assets/Scripts/Controllers/AIController.cs file:///Users/elliotsmyth/help me/Assets/Scripts/Controllers/InputController.cs file:///Users/elliotsmyth/help me/Assets/Scripts/Controllers/PlayerController.cs file:///Users/elliotsmyth/help me/Assets/Scripts/Checks/Ground.cs file:///Users/elliotsmyth/help me/Assets/Scripts/Capabilities/Move.cs

CodePudding user response:

It basically means you imported the InputSystem package into your project and have set the EditProject SettingsPlayerOther SettingsActive Input handling to only the new Input System.

However, somewhere in your code you are still trying to use the old Input class e.g.

Input.GetKeyDown(...)

or

Input.mousePosition

etc. which is no longer available due to your settings.

Solution:

  • You either want to find that usage of Input and replace it by something going through the new Input System (so basically your InputActions)

  • Or you adjust the EditProject SettingsPlayerOther SettingsActive Input handling to use a hybrid approach and allow both input systems simultaneously by setting it to Both

enter image description here

  • Related