# Timer by Function doesn't loop.

**URL:** <https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870>\
**Category:** Audio\
**Tags:** timer, unreal-engine, loop, Blueprint, question\
**Created:** [November 8, 2015, 9:57pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870 "2015-11-08T21:57:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b885638c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b885638c](https://forums.unrealengine.com/u/anonymous_user_b885638c)\
**Post date:** [November 8, 2015, 9:57pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/1 "2015-11-08T21:57:45Z")

</div>

[http://puu.sh/ler01/a46b3d779d.jpg](http://puu.sh/ler01/a46b3d779d.jpg)

Can anyone tell me what I’m doing wrong? I can’t get the timer to work and I’ve tried many methods. I ended up making my own, but I really want to find out why doesn’t it keep looping. I mean the weird thing is that despite confirming that it does get executed, after that the TimerCheck functions return False and 0 respectively.

I would really appreciate if this is explained to me since it is kind of a mystery to me atm.

Edit: [Here’s a link][2] to the full jpg , I don’t know how to make the picture clickable.

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [November 8, 2015, 10:57pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/2 "2015-11-08T22:57:59Z")

</div>

What happens if you use Set Timer by Event?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b885638c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b885638c](https://forums.unrealengine.com/u/anonymous_user_b885638c)\
**Post date:** [November 8, 2015, 11:01pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/3 "2015-11-08T23:01:18Z")

</div>

I haven’t done that since I need to fire a function. Plus I just want to know why what I have done here doesn’t work. As already stated I have achieved my goal of having a function fired off every 1 second. I just want to know for future reference. I don’t think this is a bug because I failed to find a similar issue on the forums or in the hub.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0828e68e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0828e68e](https://forums.unrealengine.com/u/anonymous_user_0828e68e)\
**Post date:** [November 9, 2015, 3:18am UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/4 "2015-11-09T03:18:59Z")

</div>

Is it because you are not sending the other parameter to the function?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b885638c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b885638c](https://forums.unrealengine.com/u/anonymous_user_b885638c)\
**Post date:** [November 9, 2015, 6:00pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/5 "2015-11-09T18:00:40Z")

</div>

No that doesn’t have anything to do with it. The function works fine, it’s the timer that’s broken.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [November 9, 2015, 6:35pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/6 "2015-11-09T18:35:49Z")

</div>

Currently it looks like your function isn’t actually doing anything. You should put any information that you want the timer to run into a custom event. Rename the custom event to the function name you set in your “Set Timer” node.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b885638c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b885638c](https://forums.unrealengine.com/u/anonymous_user_b885638c)\
**Post date:** [November 9, 2015, 8:08pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/7 "2015-11-09T20:08:51Z")

</div>

I figured it out. Apparently local variables get nulled after completion. So the Relative Object that I was plugging in was only stored locally for 1 iteration. Therefore after the first execution the variable was reset and the function didn’t have anything to work with.

Ripping the local variable out of the function, removing the input parameter and running via the timer worked.

Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b885638c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b885638c](https://forums.unrealengine.com/u/anonymous_user_b885638c)\
**Post date:** [November 9, 2015, 8:11pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/8 "2015-11-09T20:11:21Z")

</div>

The function was working only once through the execution pin when I hooked it up. But after that one run the timer still couldn’t run it.

Is there a way to tell UE4 not to reset local variables to default? I made the function under the assumption that it will keep the reference that was passed through the input parameter.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_10d8df2d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_10d8df2d](https://forums.unrealengine.com/u/anonymous_user_10d8df2d)\
**Post date:** [August 16, 2016, 2:06pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/9 "2016-08-16T14:06:51Z")

</div>

I have a similar problem though I pass a reference in a custom function as input and the timer does only one loop. Can anyone help?

 ![103078-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/6/666ff40496a70595dae5bf4d63126382c5320e14.png)

---

<div class="post-metadata">

**Author:** ![0vr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0vr](https://forums.unrealengine.com/u/0vr)\
**Post date:** [November 23, 2017, 6:29am UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/10 "2017-11-23T06:29:21Z")

</div>

I’m having the same issue but I’m not using local variables so that doesn’t stop it from happening. I’ve taken variables from a Hit Event and I’m firing an event in the Event Graph but it only fires once even though it’s set to loop.

---

<div class="post-metadata">

**Author:** ![0vr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0vr](https://forums.unrealengine.com/u/0vr)\
**Post date:** [November 23, 2017, 6:30am UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/11 "2017-11-23T06:30:31Z")

</div>

to clarify: the variables are set after a Hit Event, I’m not just pulling straight from the Hit Event’s data.

---

<div class="post-metadata">

**Author:** ![0vr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0vr](https://forums.unrealengine.com/u/0vr)\
**Post date:** [November 23, 2017, 6:58am UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/12 "2017-11-23T06:58:36Z")

</div>

Ok I figured it out: I was setting a variable on a Hit Event and somehow right after the first time it fired it was always hitting something else so it wasn’t sending off an Interface Message to the right BP. The timer is fine.

---

<div class="post-metadata">

**Author:** ![RedcapeStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RedcapeStudios](https://forums.unrealengine.com/u/RedcapeStudios)\
**Post date:** [February 3, 2025, 3:03pm UTC](https://forums.unrealengine.com/t/timer-by-function-doesnt-loop/337870/13 "2025-02-03T15:03:59Z")

</div>

![Screenshot 2025-02-03 121708](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/2/ea238ceeca8b65c591969d9b92de6b2be36f4814.png)  
can anyone please explain the reason why the set timer by event is executed only once or sometimes twice.  
the decrement happens from 10 to 9 or 10 to 8 and stops forever
