# Why can't I add a Delay Node to a function?

**URL:** <https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366>\
**Category:** Blueprint\
**Tags:** node, event-graph, unreal-engine, function, editor, question, Blueprint\
**Created:** [May 27, 2014, 5:17pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366 "2014-05-27T17:17:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Denny](https://forums.unrealengine.com/u/Denny)\
**Post date:** [May 27, 2014, 5:17pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/1 "2014-05-27T17:17:30Z")

</div>

This relates to Unreal Engine 4.1.0 via the Launcher.

I can add Delay Nodes to any Event Graph, even the Animation Blueprint. I can not however add it to construction scripts and functions used in the Event Graph.

Reproduce (using both right click and D-shortcut):

1. Create any Blueprint.
2. Open Event Graph.
3. Add Delay Node. OK
4. Add Function.
5. Try add Delay node inside Function. NOT OK

Is this a limitation by design or a bug? I find it odd that delay nodes doesn’t work inside functions while timers do. I’ve tried searching the AnswerHub, and the documentation, but I can’t find any information about this.

I’m just thinking that there could be situations where you could have a behavior with delays that you may want to reuse as part of a function. For example, function does: Do X, wait, then Y.

If it is by design I would appreciate a basic rundown of the technical aspects to better understand how Blueprint is structured. Thank you!

---

<div class="post-metadata">

**Author:** ![AlwysAnrchy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlwysAnrchy](https://forums.unrealengine.com/u/AlwysAnrchy)\
**Post date:** [May 27, 2014, 5:51pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/2 "2014-05-27T17:51:59Z")

</div>

Hey Denny,

This is a limitation by design. In a function or macro, you can not have a latent node or anything that takes time, like timelines and delays. We have attempted to implement delay and timelines into functions and macros before, but it is only causing other issues to arise. This may be reopened and looked into at a later time.

Thanks and have a great day!

---

<div class="post-metadata">

**Author:** ![Denny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Denny](https://forums.unrealengine.com/u/Denny)\
**Post date:** [May 27, 2014, 6:51pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/3 "2014-05-27T18:51:28Z")

</div>

Thank you Sean.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e815e8ea](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e815e8ea](https://forums.unrealengine.com/u/anonymous_user_e815e8ea)\
**Post date:** [March 25, 2015, 4:32pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/4 "2015-03-25T16:32:56Z")

</div>

This feature would be really appreciated…

---

<div class="post-metadata">

**Author:** ![AlwysAnrchy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlwysAnrchy](https://forums.unrealengine.com/u/AlwysAnrchy)\
**Post date:** [March 25, 2015, 4:38pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/5 "2015-03-25T16:38:14Z")

</div>

Howdy paragonx,

I will be sure to bring this up the blueprint devs and see if there have been any further discussions, though this is working as intended.

Thanks!

---

<div class="post-metadata">

**Author:** ![alperenakyuz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alperenakyuz](https://forums.unrealengine.com/u/alperenakyuz)\
**Post date:** [March 25, 2015, 6:54pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/6 "2015-03-25T18:54:45Z")

</div>

Instead of functions, you can just use collapsed nodes with inputs/outputs and delays.

---

<div class="post-metadata">

**Author:** ![Sentient](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentient](https://forums.unrealengine.com/u/Sentient)\
**Post date:** [March 28, 2015, 8:39pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/7 "2015-03-28T20:39:26Z")

</div>

Would this also be why MoveComponentTo isn’t available in a function? I just ran into this and was wondering what why I couldn’t find it…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_590cb5931](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_590cb5931](https://forums.unrealengine.com/u/anonymous_user_590cb5931)\
**Post date:** [June 18, 2015, 8:52am UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/8 "2015-06-18T08:52:32Z")

</div>

When it will be implemented?

---

<div class="post-metadata">

**Author:** ![AlwysAnrchy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlwysAnrchy](https://forums.unrealengine.com/u/AlwysAnrchy)\
**Post date:** [June 18, 2015, 7:19pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/9 "2015-06-18T19:19:15Z")

</div>

Howdy Arthur,

Thank you for responding to this issue. I reached for additional information and here is a bit of the information that I got back:

This feature is a design constraint that will not be changed. The reason is that functions have return values, and can be called from native code. Because things can be relying on the return value of a function, we don’t want to break the game thread waiting for that code to finish delaying.

Event Graph has shared state, and is re-entrant. That allows a degree of flexibility, because we’re saying nothing depends on the result of anything. That’s why events don’t have return values, and allow for delays and other latent functions.

In short, the contract is: if you have a return value, then someone is depending on your code to return as fast as possible, so no delays. If you’re an event, you don’t have a return value, so you’re free to do what you want.

Thanks and have a great day!

---

<div class="post-metadata">

**Author:** ![trepid\_jon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@trepid\_jon](https://forums.unrealengine.com/u/trepid_jon)\
**Post date:** [December 10, 2015, 4:32pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/10 "2015-12-10T16:32:15Z")

</div>

It seems pretty feasible to let people call an output-less delayed node in a function or macro if it’s an issue of not wanting to let a function or macro wait for the delay / break the timeline. Or add special rules to the outputs so they can’t be part of the default return, like color the output wires different than white and/or with dashes or something…or ideally make them have depth since that’s what’s really going on with the timeline at that point.

The issue stems from too many systems and features (and people) thinking flat and “2D” instead of having “3D” / an extra depth in mind. Imagine Blueprints in 3D, and if you break from the default flat timeline then it’s popped front or back, and could be visualized as such easily thanks to it already being in 3D. I have a theory that when the majority of our workstations transition to VR and AR and holograms and more software / OSes are VR-ready (aka 3D), everything and everyone will start thinking with 3D in mind and limits like no delays in functions/macros will vanish. Then you stop limiting yourself to 3D and it gets even wilder.

“Now you are thinking with portals.”

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8474fbfb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8474fbfb](https://forums.unrealengine.com/u/anonymous_user_8474fbfb)\
**Post date:** [June 16, 2016, 2:31pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/11 "2016-06-16T14:31:34Z")

</div>

i have a solution to open a fonction after delay in an other function , that what i were searching for  
set timer by function name with loop=false

 ![94846-sans+titre.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/3/183d1af5095ef00a4e9f35bba72ac9aee81df51b.png)

---

<div class="post-metadata">

**Author:** ![GG-GoraGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gg-goragames/32/1081623_2.png) [@GG-GoraGames](https://forums.unrealengine.com/u/GG-GoraGames)\
**Post date:** [April 9, 2017, 11:45am UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/12 "2017-04-09T11:45:13Z")

</div>

Still no news on this?

---

<div class="post-metadata">

**Author:** ![Arty-McLabin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arty-mclabin/32/1012076_2.png) [@Arty-McLabin](https://forums.unrealengine.com/u/Arty-McLabin)\
**Post date:** [April 9, 2017, 1:22pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/13 "2017-04-09T13:22:55Z")

</div>

native Loops also don’t have the option to lose delay or time operations between loop cycles.  
i have made a macro library of alternative loops that do have option for delay, if enough people here are interested i will submit it to marketplace for free later on. let me know 😛

---

<div class="post-metadata">

**Author:** ![DavidLCarson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DavidLCarson](https://forums.unrealengine.com/u/DavidLCarson)\
**Post date:** [May 5, 2017, 3:48pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/14 "2017-05-05T15:48:49Z")

</div>

You can break the function into two functions. Where you’re currently calling the function (for instance from a trigger), Call function 1. Call Delay. Call function 2. Make sure the delay includes execution time for function 1. Works for me.

---

<div class="post-metadata">

**Author:** ![Tzanai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tzanai](https://forums.unrealengine.com/u/Tzanai)\
**Post date:** [May 23, 2017, 12:40am UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/15 "2017-05-23T00:40:29Z")

</div>

One solution I found for my case was to call a custom event which held the delay node. The problem with this, of course, is that the rest of the function will not wait, but this is a muzzle flash in my case so that is irrelevant.

---

<div class="post-metadata">

**Author:** ![DaleBosio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DaleBosio](https://forums.unrealengine.com/u/DaleBosio)\
**Post date:** [August 14, 2017, 8:16pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/16 "2017-08-14T20:16:52Z")

</div>

Here is a another simple solution for delay in function:  
Lets say you want to switch between 2 cameras every 5 seconds.  
In event graph add SetTimerByFunction, Create 2 functions (State1 and State2). In each State Function add Sequence (as HitEmUp posted). In Sequence in pin 1 add what to do and pin 2 add SetTimerByFunction calling opposite Function (state) with delay of 5 seconds. Back on Event Graph. In SetTimerByFunction call State 1 function and mark Looping.

---

<div class="post-metadata">

**Author:** ![WimbleSoft](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wimblesoft/32/582012_2.png) [@WimbleSoft](https://forums.unrealengine.com/u/WimbleSoft)\
**Post date:** [June 16, 2018, 12:30pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/17 "2018-06-16T12:30:57Z")

</div>

I recreated ForEachLoop macro in to a collapsed node by looking at sidebyside screens, it worked. I’m trying to create a slideshow to background. In the image below, you should check carefully where I put delay function.

 ![244505-foreachloopwithdelay.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/2/7825a5ef449e485a749d68d5cb8158c4af46957f.jpeg)

---

<div class="post-metadata">

**Author:** ![Spaz\_Killington](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spaz\_Killington](https://forums.unrealengine.com/u/Spaz_Killington)\
**Post date:** [June 30, 2018, 8:57pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/18 "2018-06-30T20:57:36Z")

</div>

Why not just add a concept of private functions that are meant to be used by the current graph only? The functions are nice because you don’t have to create massive graphs. Coming from a programming background (and someone how has always used Visual Studio), I find these massive graphs to be clumsy.

---

<div class="post-metadata">

**Author:** ![Zarrar2802](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zarrar2802/32/710746_2.png) [@Zarrar2802](https://forums.unrealengine.com/u/Zarrar2802)\
**Post date:** [April 8, 2021, 12:31am UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/19 "2021-04-08T00:31:04Z")

</div>

I didn’t read the whole thread so sorry if this has been mentioned before. What you can do is add a sequence pin and execute your function from there. On the second pin you can add a delay and use it to set a boolean variable to true. Add a branch in your function to check if the boolean is set true or not. This worked for me when I was using a single function to fire multiple weapons, with the function having inputs to change values such as muzzle flash and projectile type wrt the weapon in hand.

I needed a way to add a cap to the number of times the player can spam the fire key cause it would create a rapid fire which is at a much higher rate than the automatic fire anim notify i was using to trigger the function again and again.

Hope you can use this trick to adjust it to your code.

---

<div class="post-metadata">

**Author:** ![Willard720](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Willard720](https://forums.unrealengine.com/u/Willard720)\
**Post date:** [August 10, 2022, 8:33pm UTC](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366/20 "2022-08-10T20:33:34Z")

</div>

This is a _really_ bad idea. Literally nothing is gained by making it 3d, it sounds cool and futuristic, but super hard to read. You’ll have to be constantly moving the nodes around shifting perspective, and angles just to find the things you need. What advantage will this _actually_ bring? Also, how would things even turn directions in the third space, nodes will still only have one exec wire, so its totally possible to rearrange them to be flat plane. If you need more space, just use collapsed nodes, functions and macros, ffs.

This just seems like building a language all around it being hard to visualize for it looking cool and advanced like the movies or something, but seriously, what is the point? Portals let you travel two points instantly (kind of like a node does) adding a dimension isn’t always the answer.

“Now you’re thinking with logic.”

[Next page](https://forums.unrealengine.com/t/why-cant-i-add-a-delay-node-to-a-function/284366.md?page=2)
