Blueprint SetGamePaused Function Proper Use

I am trying to get a handle on the blueprint features. I want to use the SetGamePaused node but I have some confusion about how it works.

  1. Where would a pause function go? For example, would this go in the MyGame Blueprint?

  2. I have a node for a button press that I flow into the pause feature but I need to pass info to the bool to toggle it correct? What is the proper way of doing this because as of yet, none of my tests have worked.

Thank you for any help on the matter.

I’m using SetGamePaused in a class blureprint MyPlayerController which is assigned in MyGameMode – via the roll down in the Blueprint icon in the main toolbar.

In the eventgraph, I have two functions, one for bool Paused using the tickbox on and another one for off.
These functions also show/hid the cursor and enable/disable click events.
Then, the functions can be fired from anywhere you like.

It works nicely, except the blue text that display in the middle of the screen.

  1. You’ll want to call the function commonly in the blueprint where your movement controls are. Some people do it in PlayerCharacter others in PlayerController.
    e.g. EscPressed > SetGamePaused ‘True’ > create widget ‘MainMenu’ > set widget reference > add to viewport > Show mouse cursor ’ True’
    Then if you want to be able to hit escape again to close it and unpause then right click the event and select run when paused.

You can also toss a boolean in after pressed called isPaused? with a branch and on the true you could set it to false then grab the widget reference you created, remove from parent, set game paused ‘False’.
Then from the False branch pin, you would put the first mentioned method.