With the new input system, how do I switch between my input working with the menu to working with a player character in the game world?
With the old system I had actually set up a input script that I could attach to any game object that wanted to read player input, and switching between a menu and gameplay was simply a matter of having the object’s script ignore most of the input depending on if the menu was open. (For which I just checked the current time scale.)
I thought it would be a similar plan with the new input system. I add my player input to my player game object, and I add my player input to my game manager that controls menus and stuff.
I even made a separate action map for the player than for the UI within my input actions to help keep things organized.
But when I have two player inputs in my scene, only one works.
Now the new input system is designed to work with multiple inputs for multiple characters, so I’m guessing this is trying to lock out duplicates trying to use the same controller, so if I add a second character into my game I’m supposed to use a second controller for the second player. But I’m not making a multiplayer section; if the player is using a keyboard they are going to use that same keyboard for both the player and the menu.
So how am I supposed to switch active control between these player inputs in my scene? How do I dictate if the player’s input is trying to work the menu or if they are working the player character?
I have the same question. I’m doing it by disabling the character controller as well the cinemamachine brain components while the players responds to menus and then re-enabling them afterward. But I figure there must be a more straightforward way to do this.