Help! How Do I Use Coins To Limit Power Button?

Discussion in 'Gameplay' started by Jesse O'Brien, Mar 26, 2020.

  1. Jesse O'Brien

    Jesse O'Brien Boxer

    Joined:
    Jan 15, 2020
    Messages:
    8
    Likes Received:
    0
    Hi boxers! I have a game where collecting a coin gives you the ability to press a UI button (so a 'Session Coins = 1' Event Observer triggers a UI interface where the button can be activated.

    Think of it like you're a Power Ranger, but you start in human form. And if you collect a coin, the MORPH button appears on your UI that you can press any time. And when you press it, you morph into a Ranger for ten seconds. That's the premise.

    My problem is, I need to be able to store up coins. So if I collect 5 coins before activating, I can keep pressing the button 5 times before the button goes away. And each time you press the button it allows you start the ten seconds over, prolonging your time in powered up form.

    The UI just doesn't work. I've made a node map where 'Session Coins = 2' loads the 2nd UI screen with a 2 label, etc. Going up is fine, the UI loads up and up. But the problem is when I activate the button, it should return to the previous UI screen (a lower number on the button, as I've just spent a coin). If I connect all these nodes, the game crashes when I collect a coin.

    Does anyone know a better way to do this? I wish there was a pre-programmed power button that could only activated based on how many coins you have. Please help!
     
  2. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,224
    Likes Received:
    522
    You could try using the state machine? Each state pointing to the relevant coins action? Then reset after 5th press or something.
     

Share This Page