Monday, 8 May 2017

Pause Menu - Un-pausing

For my menu system, one of the goals is controller functionality.

To see how I achieved controller funtions on the menu buttons, see the post titled Menus with Controller Support.

A problem I ran into with my pause menu was that when you pause the game, everything that isn't running in the menu pauses, including outside controller functions. This means that you cannot un-pause a game using a controller face button unless you do a specific thing.

The first method I tried was simply having a Flip/Flop on the player controller that paused and un-paused the game each time it was pressed. This failed due to the above problem; functions on the player character pause when the game pauses.

I also tried to use standard button input captures in the actual menu, but those are not directly supported (but I was on the correct line of thought).

A new tact was needed:

Function Input Overrides

This special type of function allows a menu widget to capture button inputs that aren't part of the normal navigation or mouse interaction associated with menus.

In this instance I'm getting a capture for either the controller 'Start' button or the 'P' button on the keyboard, which if detected will use an event dispatcher that communicates with the player character to take the game out of it's paused state and remove the menu widget from the screen.



I think this is an okay way of doing things, but it would be nice if Epic implemented standard input calls into the menu, as this would make it easier to assign things to specific buttons without going through a special function, which could end up having several branches if many button functions are required.

No comments:

Post a Comment