Forum rules - please read before posting.

Delay menu click

Hello folks  :-h

I have a simple question.. How do I delay clicks? For example when I press a button to show the "Inventory" I want to wait a bit before I can close it, and same for opening it again. Because whenever I press the button fast it just opens and closes the inventory so fast that it makes a lot of bugs.. 
:(

What should I do to make a simple short delay? 

Comments

  • You can use the Menu: Check state Action to determine if a Menu is fully visible or not.  If the Menu has a non-zero transition time, then this check will return False if the Menu is still fading in.

    Therefore, you can give the Menu a fade transition, and then use the "Menu: Check state" Action before using Menu: Change state to close the Menu only if it is fully visible.
  • edited February 2017
    Hello, @ChrisIceBox

    So in order to do that I have to go to [Menu] > [Inventory] > and in the "ActionList when turned on" I should put a check state first? then what? I'm kinda noob. If you could please tell me by detail how to achieve this you would be my hero man! :( 
  • edited February 2017
    No, the "ActionList when turned on" is for when you want something to happen when the Menu turns on.  Instead, you want the Actionlist to run when the button inside the Menu is clicked.

    How you do it exactly depends.  What is your Menu's Appear type set to, and how are you currently opening and closing it?  By invoking an input key, or by pressing a Button inside a Menu?
  • @ChrisIceBox ;

    My Inventory menu appear type is set to [On Input Key] And I'm depending on it to open and close the menu. When I press *B* on my controller it opens the Inventory menu. 

  • Did you try giving the Menu a non-zero Transition time?

    If holding a button down once, and the Menu is opening and then closing instantly, then that sounds like a bug.  What version are you using?  Be sure do download the latest version, v1.55c, from the Asset Store.  I can't reproduce this issue, and in order to fix it, we know it's occuring with the latest release.
  • No no, it doesn't close and open instantly.. That's not my issue. I may didn't explain very well due to my lack of English.. Everything is working fine, but i'm just trying to find a way to open the menu and then wait a bit before I can close it again.. So that If I kept on pressing the button rapidly it wont open and close too fast.. So that it would look more of a game.

    Sorry for bothering you that much.. :( 
  • I see.  In that case, you'll have to rely on Active Inputs to do it.  Active Inputs allow you to trigger ActionLists when an input button is pressed, so you can use this to manually turn the Menu on and off instead of doing it via the Menu's "Appear type" setting.
    1. Set the Menu's Appear type to Manual
    2. Create a new Active Input (see the Manual's Section 2.14) and map it to the same Input you're using to open the Menu (linked to "B" key)
    3. Create a new ActionList asset that runs when this Active Input is run
    4. Inside this ActionList, create a Menu: Check state Action that checks if the Inventory menu is open.  If it is, use a Menu: Change state Action that closes the Menu.  If it isn't, use another Menu: Change state Action that opens it.

    By this point, you should have the same functionality as before: the Menu toggles on and off when the "B" key is pressed.  Now you can insert a delay:

    1. In your Menu's list of properties, create an ActionList when turn on, and give it a single Engine: Wait Action of however long you want the wait to last.
    2. Set the ActionList's When running property to Run In Background, so that it doesn't interfere with gameplay.
    3. Back in your Active Input's ActionList, insert an ActionList: Check Action in between the Menu: Check state Action and the Menu: Change state Action that turns the Menu off.  Have this ActionList check to see if the ActionList when turn on is running, so that the Menu: Change state Action doesn't run if it is.  Basically, you want to prevent that Action from running if the other ActionList is still running.
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.
Do NOT follow this link or you will be banned from the site!