I want the Escape key on the keyboard to perform several things depending on the situation the player is in:
In the title screen, do nothing (let the menu widget be drawn permanently)
In game mode, it opens the game’s Main Menu
When talking to a character in dialog mode, it will just cancel the dialog
In generic dialog prompts, it’s basically a generic shortcut to the “Cancel” or “Close” buttons
In character stats display, it will be used as a generic “back” function for multi-page menus
A further challenge is that these situations must all be mutually exclusive, as in - if the player is in dialog mode, pressing Escape should NOT open the Main Menu.
I am currently checking for the Escape key via an Input Event in the PlayerController - with Switch statements.
So my question is, is this the best way to do it or not? Because I am finding it difficult to manage the Blueprint when I dump so many specific checks inside the PlayerController.
Did You Know?
You can have more than one Event Graph in a blueprint.
I believe you are handling it in probably the best-case scenario that could be done in such a situation. If you want to make it easier to manage, you could offload-it to another Event Graph and your main one won’t be so overwhelming.