Announcement

Collapse
No announcement yet.

Timer By Event - Delay on first loop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Timer By Event - Delay on first loop

    I have a timer by event node that handles my stamina increasing after stamina use stops. I want a delay on the first loop through so stamina doesn't increase again immediately. I cannot put the delay before the timer as this causes a delay in clearing the "Decrease Stamina" timer event. I have tried putting a boolean to check if it's the first time but I guess it loops every 0.05 seconds regardless and it's skipping the delay. How can I get this delay implemented?


    #2
    I added a sequence node before the delay and made sure 0 cleared the timer which has semi-resolved the issue. The issue now is that a re-use of stamina (ie dodge a few times) does not reset the delay

    Comment


      #3
      If you just want the stamina to recover over time after a set period after use, can't you just do this?
      YouTube channel: https://m.youtube.com/channel/UC1qaQM1VnY441J5lCLCPMwg

      Comment


        #4
        I could do but I'm trying to avoid using Event Tick where possible.

        Also general question based on your screenshot; what is the benefit of directly setting the percent of a progress bar as opposed to binding it to the difference between two values (eg a current and a max healt/stamina/mana etc etc)?

        Comment


          #5
          I solved the issue! I created a boolean called UsingStamina which I set to true every time I, you guessed it, use stamina! And then I set it to false on the increase event. When increasing I do a check in the loop to see if it has become true and stop the event if it has

          Comment


            #6
            Originally posted by Jackimedes View Post
            I solved the issue! I created a boolean called UsingStamina which I set to true every time I, you guessed it, use stamina! And then I set it to false on the increase event. When increasing I do a check in the loop to see if it has become true and stop the event if it has
            Belay that, multiple dodges does not reset the delay

            Comment


              #7
              try a retriggerable delay instead.
              Tracey White - Senior Design Visualization Artist / PC Game Enthusiast / Drummer
              My Maze Game development video series
              My Maze Game Blog

              Comment


                #8
                This solved it

                Comment


                  #9
                  You could also block it using DoOnce node, this way the gate will stay closed for the next iteration until the delay node finishes.

                  Comment

                  Working...
                  X