How to Get input mode

Hi,
I’m trying to solve a problem with my pause menu system. My current problem is that i use both “game only” and “game and UI” input modes in the game (game for moving, game and UI for accessing inventory). When pause menu opens, i set the mode to game and UI but when it closes i want to go back to the input mode i was in before. If it doesn’t pick a proper mode the player either can’t interact with inventory or can’t play the game normally (depending on in which state he opened the menu).
I wanted to solve this by saving the state before opening pause menu and going back to it when the pause menu closes but apparently there’s no “get input mode” node. Is there any way of accessing it? If not, how else can i solve this issue?
Thanks.

I don’t think it exists. But even if it did, it wouldn’t help you.

You very quickly run into the scenario where the player can press ESC several times to get out of submenus. Going back to a previous input mode, doesn’t make any sense in that example, because you need to stay in UI, until the player wants to go back to the game.

My menu doesn’t have submenus and i don’t intend to have them. It’s either you’re in the menu or not. Pressing ESC either opens the menu or closes it.

OK, then you can just NOT a boolean to keep track of where you are :slight_smile:

352567-screenshot-1.jpg

I can easily check whether or not the pause menu is on, it’s not the issue. I want to have information which input mode to set after closing the menu.

Same sort of concept, a variable will do it.

Use a master class that manages your entire HUD and decides what input mode is required, make it the only class that alters the input mode.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.