I’m working on a local Multiplayer game, using the new input system. I’m wondering if there’s a way to restrict my menu UI navigation to just ‘Player 1’.
Similar to some other couch co-op games, where ‘Player 1’ is the only player able to navigate around the menu and change stuff.
Hello
@Impact99 I had the same issue than you and I managed to find a solution. I made the Pause Menu a canvas in the game scene that you would SetActive(false) or SetActive(true). I then added 1 multiplayer event system (with its UI input module) per player, with the pause menu canvas as the player root, and linked every players with their respective UI input module. When 1 player presses pause, I use InputSystem.DisableDevice to disable all other players’ devices. Don’t forget to enable them back once you exit the pause menu using InputSystem.EnableDevice.
I assume you have some class, like a Player or PLayerController, where you have the user number set that each player has been assigned, correct?
Simply provide a way to get that ID in the class where you have your UI navigation. If possible, set it in a local variable in your Start() method. Otherwise, just check for it in the navigation methods by calling the method to get the current player ID and only allow navigation events to work if they are Player #1.
Yeah, I’m having the same problem as well. I need to be able to only allow the player who pauses to control the pause menu and I’m not sure how to move forward from here.