"Execute When paused" Action Input not working

I have set up a UE4 widget which pauses the game and opens with a key press. If the key is pressed again while the menu is open it should close.

It doesn’t.

I have checked the input and it has the “Execute while paused” flag set in the Controller to allow the input to be processed.

For the unpause I placed the following code into the widget itself:

Viewing the player controller during runtime seems to show that the Action Input is not firing once the game is paused, despite the flag being set. Any ideas?

Thanks.

1 Like

A few questions:

  • Does this work if you don’t pause the game?
  • Why are you calling the ListenForInputAction on a Tick? It should be enough if you do it on BeginPlay (EventConstruct on the widget)

You can try alternatively calling the CloseInventory from the PlayerController. Although it is not ideal, it would be worth checking if that works.

EDIT: I just realized you are consuming the input on the PlayerController. Try disabling that, so the input reaches the widget.

This does work if I don’t pause the game.

Tick was my first port of call. I hadn’t considered that listen would run indefinitely on a BeginPlay. That’s my ignoracne showing through.

If I do not consume the input then it closes as soon as it opens (I tested this while pause was not enabled)

This leads me to believe that even though I have told the key to still process when paused it is somehow not doing so.

EDIT: In the PlayerController, i added a simple print string when the branch returned a true, i.e. when the widget is showing. This also didn’t process. It looks more and more like the input is not being triggered at all whilst the widget is present, but listen for input in the widget is not responding whilst the game is paused?

Well going through this video tutorial resolved my issue. Perhaps it was the way my PlayerController handled pause inputs or maybe it was a bug. Either way it is now resolved.

1 Like

I solved the problem changing the node “Set Input Mode UI Only” to “Set input mode Game and UI”