# Delay node only runs the first time custom event is called, never runs again

**URL:** <https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [August 3, 2022, 2:23pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618 "2022-08-03T14:23:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lowenfas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lowenfas](https://forums.unrealengine.com/u/Lowenfas)\
**Post date:** [August 3, 2022, 2:23pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/1 "2022-08-03T14:23:16Z")

</div>

This event is called every time you pick up a weapon, I did a lot of tests with print strings and I can see the first time it’s called it runs through perfectly, it loops when it needs to and the delay works just fine every time.

The Second time it’s called though it gets to the delay node and just stops. A print string right before the delay will get called but nothing after the delay will get called. I don’t get any errors or anything. I tried this same code with retriggerable delay but get the exact same outcome.

 ![Screen Shot 2022-08-03 at 10.17.06 AM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/d/f0d4856f4aab67cdec559692cf0e9517ac478aa0.png)

The delay node just completely stops the code, but only the SECOND time the event is called. WHY

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [August 3, 2022, 3:03pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/2 "2022-08-03T15:03:55Z")

</div>

If the delay hasn’t finished counting, if will ignore new calls. Once it’s finished, you can call it again and set a new delay.

---

<div class="post-metadata">

**Author:** ![Lowenfas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lowenfas](https://forums.unrealengine.com/u/Lowenfas)\
**Post date:** [August 3, 2022, 6:49pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/3 "2022-08-03T18:49:03Z")

</div>

But isn’t that what a retriggerable delay is for, every time you call it it restarts the delay timer? Because retriggerables don’t work either.

Also I get what your saying with the delay ignoring new calls but I don’t see how that is relevant in this code, you call the event initially and then it loops until the event finishes by spawning a new actor. Once that happens the delay should work the next time it’s called right?

---

<div class="post-metadata">

**Author:** ![L.F.A](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/l.f.a/32/1194525_2.png) [@L.F.A](https://forums.unrealengine.com/u/L.F.A)\
**Post date:** [August 3, 2022, 6:52pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/4 "2022-08-03T18:52:49Z")

</div>

Hi there,  
How are you calling that event Respawn Pickup? Are you using a “for each loop” or something?  
If so, loop macros will not work with delays, so you need custom macros.

[UE4 Tutorial - For Each Loop With Delay - YouTube](https://www.youtube.com/watch?v=2RfEp6LOfK0)

---

<div class="post-metadata">

**Author:** ![Lowenfas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lowenfas](https://forums.unrealengine.com/u/Lowenfas)\
**Post date:** [August 3, 2022, 6:59pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/5 "2022-08-03T18:59:11Z")

</div>

Whenever you pickup an item on the ground the item is destroyed and this Respawn Pickup function is called.  
The idea is that the item will respawn but only after a certain amount of time and only if the player is not nearby. The only loop is if the weapon is trying to respawn but the player is too close, the weapon will wait X seconds before checking player distance and potentially respawning

---

<div class="post-metadata">

**Author:** ![c0r37py](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/c0r37py/32/559700_2.png) [@c0r37py](https://forums.unrealengine.com/u/c0r37py)\
**Post date:** [August 3, 2022, 7:02pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/6 "2022-08-03T19:02:58Z")

</div>

test with smaller and bigger value, you will get what you want to know.

---

<div class="post-metadata">

**Author:** ![Lowenfas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lowenfas](https://forums.unrealengine.com/u/Lowenfas)\
**Post date:** [August 3, 2022, 7:13pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/7 "2022-08-03T19:13:42Z")

</div>

I don’t really understand what you’re saying. I have put different values in the delay but it’s always the same thing.

The first time the Respawn Pickup is called it works perfectly, even if the branch is true it will loop the proper amount of times until it respawns and the loop ends. BUT, the second time that Respawn Pickup is called the code just stops running at that delay node.

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [August 3, 2022, 8:11pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/8 "2022-08-03T20:11:23Z")

</div>

Waaait, you’re saying that this code is in the object that’s being destroyed? Are you trying to use a latent function (delay in this case) after you call destroy on this actor?

---

<div class="post-metadata">

**Author:** ![Lowenfas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lowenfas](https://forums.unrealengine.com/u/Lowenfas)\
**Post date:** [August 3, 2022, 9:55pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/9 "2022-08-03T21:55:29Z")

</div>

For my weapon pickup I’m using Set Actor Hidden In Game.

But your comment does explain why my battery pickup didn’t work, I was destroying the actor on that one. Hehehe, whoops.

---

<div class="post-metadata">

**Author:** ![Lowenfas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lowenfas](https://forums.unrealengine.com/u/Lowenfas)\
**Post date:** [August 4, 2022, 12:58pm UTC](https://forums.unrealengine.com/t/delay-node-only-runs-the-first-time-custom-event-is-called-never-runs-again/620618/10 "2022-08-04T12:58:00Z")

</div>

Turns out that the weapons that I was setting to hidden were also getting destroyed later on. That explains why it worked fine initially but not the second time.

It’s very helpful to take a step back from the code while someone else takes a look at it to point out all the obvious sh\*t that Cleary won’t work.

Good teamwork guys.
