When I select a GUI button with say A on my gamepad, that same press passes through to the character actions (such as pressing A to jump). How do I prevent it from passing through like that?
There are several ways to solve this, so I’ll just describe my favorite. It’s probably not the best way, but it’s quick and easy to set up.
Create a UI Manager Singleton script and add it to you canvas. In the script, have an array of RectTransforms that, when active, block the input from the main game (e.g. dialog box background, etc.).
In the update function of the UI Manager script, loop through the RectTransforms and if any of them are active, set a blocking bool to true, otherwise reset it to false.
Then, in your scene objects that use input, just check that the UI Manager’s blocking bool is set to false before checking input.