Disabling UI Input on a per player basis

Hey guys, I’m using rewired here and I’m in a bit of a pickle. I’ve made a pause menu where, I only want the person who has actually ‘paused’ the game to be able to interact with it. I’m using rewired, and just suppressing navigation events or removing controllers doesn’t work for UI. suppressing the navigation events disables input for everyone, which is not what I want. Does anyone know how to make it so that only one player can interact with the menu at a time?

You should ask questions like this on the Rewired forum thread or using the support form on the Rewired website. I only found this because another Rewired user told me about it and linked to this question.

All you have to do is set which Players are designated to control the Rewired Standalone Input Module. There are inspector options in the Rewired Standalone Input Module to set what Players can control the UI.

You can set this through scripting at runtime using the properties in the RewiredStandaloneInputModule class:

  • UsePlayingPlayersOnly
  • UseRewiredSystemPlayer
  • UseAllRewiredGamePlayers
  • RewiredPlayerIds

Get the module at runtime:

var rsim = EventSystems.current.GetComponent<Rewired.Integration.UI.RewiredStandaloneInputModule>();
rsim.UseAllRewiredGamePlayers = false;
rsim.RewiredPlayerIds = new int[] { 0, 1, 2 };