# Is there any way to get a delay in a function

**URL:** <https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023>\
**Category:** Blueprint\
**Tags:** delay, unreal-engine, functions, UE4, Blueprint, question\
**Created:** [April 15, 2017, 10:45pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023 "2017-04-15T22:45:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 15, 2017, 10:45pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/1 "2017-04-15T22:45:09Z")

</div>

is there any way to get some sort of a delay in a function dosent matter how just need a delay i dont care how complicated it is but i need it real bad

---

<div class="post-metadata">

**Author:** ![Xosh\_project](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xosh\_project](https://forums.unrealengine.com/u/Xosh_project)\
**Post date:** [April 15, 2017, 11:10pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/2 "2017-04-15T23:10:41Z")

</div>

I recommend you to create a macro if you need to have a delay, their is no way (from my experience) to get delay node inside function.

---

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 15, 2017, 11:11pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/3 "2017-04-15T23:11:30Z")

</div>

how does a macro help me?

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [April 16, 2017, 12:28am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/4 "2017-04-16T00:28:53Z")

</div>

Unless I’m misunderstanding your question, there is an actual “Delay” node.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_731acd47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_731acd47](https://forums.unrealengine.com/u/anonymous_user_731acd47)\
**Post date:** [April 16, 2017, 12:53am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/5 "2017-04-16T00:53:03Z")

</div>

Functions are executed in a synchronous manner and everything waits until the function returns its output. Their purpose is to return a result in exactly one frame. If you don’t have any outputs from the function (and why would you purposely wait N time to get an output?) feel free to swap it for a Custom Event where you can use latent stuff.

---

<div class="post-metadata">

**Author:** ![Xosh\_project](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xosh\_project](https://forums.unrealengine.com/u/Xosh_project)\
**Post date:** [April 16, 2017, 3:28am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/6 "2017-04-16T03:28:59Z")

</div>

take a look on this → [Macros | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Macros/)

But as neelix32 say, you can push your function inside a custom event.

---

<div class="post-metadata">

**Author:** ![Xosh\_project](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xosh\_project](https://forums.unrealengine.com/u/Xosh_project)\
**Post date:** [April 16, 2017, 3:29am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/7 "2017-04-16T03:29:52Z")

</div>

He want delay node inside function.

---

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 16, 2017, 1:29pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/8 "2017-04-16T13:29:22Z")

</div>

yes but with a custom event i cant get an output from a node

---

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 16, 2017, 1:30pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/9 "2017-04-16T13:30:13Z")

</div>

i can push it inside a function but i cant get an output from it

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_731acd47](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_731acd47](https://forums.unrealengine.com/u/anonymous_user_731acd47)\
**Post date:** [April 16, 2017, 5:14pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/10 "2017-04-16T17:14:39Z")

</div>

you can always store the intermediate result in a variable instead of using an output from a function

---

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 16, 2017, 6:15pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/11 "2017-04-16T18:15:40Z")

</div>

yeah but i need an exection output not a var

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [April 16, 2017, 8:43pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/12 "2017-04-16T20:43:59Z")

</div>

Oh, just split it into two functions with a delay in between. Question is too vague to say more than that, OP is asking how to do something that can’t be done, that when phrased another way might have a solution for what he’s trying to do, but there’s no info to answer in that manner.

---

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 16, 2017, 8:56pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/13 "2017-04-16T20:56:00Z")

</div>

that wont help me because i need delay inside a funtion i cant split it into 2

---

<div class="post-metadata">

**Author:** ![Vaei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaei/32/710746_2.png) [@Vaei](https://forums.unrealengine.com/u/Vaei)\
**Post date:** [April 16, 2017, 9:01pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/14 "2017-04-16T21:01:38Z")

</div>

You can’t have a delay in a function. Maybe post a new question with what you’re actually trying to achieve and you’ll get help that does help you. 🙂

---

<div class="post-metadata">

**Author:** ![Xosh\_project](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xosh\_project](https://forums.unrealengine.com/u/Xosh_project)\
**Post date:** [April 18, 2017, 4:52am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/15 "2017-04-18T04:52:24Z")

</div>

Actually this is a good answer.

---

<div class="post-metadata">

**Author:** ![Xosh\_project](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xosh\_project](https://forums.unrealengine.com/u/Xosh_project)\
**Post date:** [April 18, 2017, 4:54am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/16 "2017-04-18T04:54:03Z")

</div>

Please take a look on this → [Macros | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Macros/)

You’ll find exactly how to have input and output with macro. You have a LOT of image that explain exactly how it work.

---

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 18, 2017, 10:10am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/17 "2017-04-18T10:10:57Z")

</div>

i know how to use macros but they cant have the 3 nodes that i need i need to cast to a widget and a macro cant do that

---

<div class="post-metadata">

**Author:** ![Xosh\_project](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xosh\_project](https://forums.unrealengine.com/u/Xosh_project)\
**Post date:** [April 18, 2017, 4:53pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/18 "2017-04-18T16:53:59Z")

</div>

From what I know, you can cast from macro when you want without any problem. Like Vaei say, open a new question to let us know what you try to achieve because I’m pretty sure this isn’t that hard to achieve with custom event/macros.

If you want send a link of the new question here in the comment.

---

<div class="post-metadata">

**Author:** ![678GUY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@678GUY](https://forums.unrealengine.com/u/678GUY)\
**Post date:** [April 18, 2017, 4:57pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/19 "2017-04-18T16:57:40Z")

</div>

i know i can cast but i cant get the refrence for the widget with get all widgets of class

---

<div class="post-metadata">

**Author:** ![Xosh\_project](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xosh\_project](https://forums.unrealengine.com/u/Xosh_project)\
**Post date:** [April 19, 2017, 4:19pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023/20 "2017-04-19T16:19:14Z")

</div>

You can maybe create a variable «Object» and get your object like this. Also please follow my advice and create a new question to expose your new problem about casting and macros (or the thing you need exacly).

[Next page](https://forums.unrealengine.com/t/is-there-any-way-to-get-a-delay-in-a-function/391023.md?page=2)
