TIL Unity Can Dual-Wield Input Systems

Sunder Iyer - Jan 23 '21 - - Dev Community

2021-01-22

I'm currently investigating Unity's (relatively) new Input System which intends to replace the Input Manager.

Screenshot of Input System in the Package Manager over the Project Setting's Input Manager
out with the old, in with the new

Of course, once you activate the new system, none of your old inputs will work in game. In fact, you'll get a bajillion errors in your console like this

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.

Well that sucks. It looks like it's one or the other. What if we needed to support a legacy implementation?
Gif of girl from Old El Pasoat taco kit asking why we can't have both
Yes it's possible to have both input methods running. An option needs to be enabled first however.
Screenshot of Active Input Handling option

Flip this switch if you need both

What's nice is you can now code using ENABLE_INPUT_SYSTEM and ENABLE_LEGACY_INPUT_MANAGER to ensure everyone plays nicely with each other!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .