Announcement

Collapse
No announcement yet.

I need to Restart a Delay node...

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

    I need to Restart a Delay node...

    I have created a game where when you pick up a coin, a HUD appears showing you how many coins you have, which then disappears after a couple of seconds. The HUD actually works, and does appear when I pick up a coin, but the problem is when I pick up another coin before the HUD disappears, I want the delay node to restart, so another 5 seconds are needed to hide the HUD. Although I have tried to find a solution (see image), the delay node does not restart when I pick two coins up in less than 5 seconds...

    Click image for larger version

Name:	Coin Amount HUD.png
Views:	1
Size:	199.0 KB
ID:	1158885

    I know that the problem is when the variable RepeatDelay is True, the delay node starts, and setting the variable back to false won't stop it. So what I want to do is when the variable is false, I want to execute a node that stops or restarts the delay node.

    If I did not explain the problem well enough, tell me!
    Last edited by JosephB2000; 08-06-2015, 11:48 AM.

    #2
    Have you tried a Retriggerable delay?
    https://docs.unrealengine.com/latest...lay/index.html

    Comment


      #3
      Originally posted by Mosel3y View Post
      Have you tried a Retriggerable delay?
      https://docs.unrealengine.com/latest...lay/index.html
      Thanks for telling me about the Retriggerable Delay, but it appears it has not worked...

      Click image for larger version

Name:	RetriggableDelay.png
Views:	1
Size:	171.7 KB
ID:	1083316

      Using this blueprint, the HUD now never disappears, and constantly stays on my screen.

      Comment


        #4
        Event Received Draw HUD is called every frame, meaning the delay is being called every frame too, so it can never close the gate (It's constantly being reset back to 1)
        Your Coin Amount Changer event could start the delay instead, using a sequence node.

        Comment


          #5
          Originally posted by Mosel3y View Post
          Event Received Draw HUD is called every frame, meaning the delay is being called every frame too, so it can never close the gate (It's constantly being reset back to 1)
          Your Coin Amount Changer event could start the delay instead, using a sequence node.
          Ahh, perfect, I knew that Event Receive Draw HUD is called every frame but I didn't realise that the delay was directly connected to the Event Receive Draw HUD. Thank you Masel3y, it works beautifully now!

          Comment

          Working...
          X