Forum rules - please read before posting.

Adding a Delay while Menu Active

I'm trying to find a way to add a delay to an ActionList while a Menu is active that pauses the game.

Currently i've got it set up so when the Player collects an Item, my NewItem menu pops up, pausing the game. The Menu enables an ActiveInput set to respond to any key press, which closes the Menu again. The issue is that if the button is being spammed, the menu closes almost instantly. I tried adding a Wait Action between the Menu opening and the Active Input being enabled, but since the game is paused, the wait timer doesn't progress.

Is there a better way to add a delay, or a type of timer that can be run during pauses, or am I best off creating a custom action that handles the Wait seperate to gameplay time?

Comments

  • edited April 23

    Welcome to the community, @Anxious_Asparagus.

    It's possible to have Actions run in real-time (i.e. ignore the paused state), but the conditions are very specific:

    • Use an ActionList asset, rather than a scene-based ActionList
    • Set its When running field to Pause Gameplay, and uncheck Unfreeze 'pause' Menus?
    • The game must already be paused when the Actions are run.

    If you've assigned this as the Menu's ActionList when turn on field, you'll need to set the first Action to an Engine: Wait that waits "-1" seconds.

    This causes a wait of a single-frame - by which time the menu has been turned on, and any other Engine: Wait Action that follows will run in real-time.

  • Thank you for the reply, that worked perfectly! Never ceases to amaze me how you've accounted for every little thing.

    My understanding then is that whenever a new menu is created, it'll pause everything else going on if specified to do so, and would be paused by subsequent menus it might create? Does that mean input will also be blocked to paused menus?

    Just trying to figure out how to best have the Menu respond to the ActiveInput, or if it's best to keep it so the ActiveInput is responsible for closing the Menu.

  • Automatically, the game will become paused if any Menu with Pause game when enabled? is checked.

    Each Active Input has a Available when game is field, though, and this can be set to Paused to have it react during this time.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.