InvalidOperationException

It’s not impacting the gameplay (yet?) but upon adding the TextMeshPro element (canvas and scoreboard text) the Unity Editor if giving me this error:

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. UnityEngine.Input.GetButtonDown (System.String buttonName) (at /home/bokken/build/output/unity/unity/Modules/InputLegacy/Input.bindings.cs:373)
UnityEngine.EventSystems.BaseInput.GetButtonDown (System.String buttonName) (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/InputModules/BaseInput.cs:126)
UnityEngine.EventSystems.StandaloneInputModule.ShouldActivateModule () (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:229)
UnityEngine.EventSystems.EventSystem.Update () (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:503)

Obviously, I’m using the “new” input system. It’s not preventing the game from playing so I’m tempted to ignore it but I also suspect this is exactly the kind of thing that could cause problems down the road.

(A couple of things worth noting: I’m running Linux (Manjaro) and, instead of Visual Code, JetBrains Rider.)

Click on the EventSystem in the hierarchy. In the inspector you should see it complain about the input systems and there should be a button that will fix it automagically. I only remember this, so I don’t have more exact details about it. I would have to recreate the scenario to be more clear, and I can’t quite do that at the moment

That was exactly what I needed. Thanks!

1 Like

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

Privacy & Terms