# Some trouble with my timer

**URL:** <https://forums.unrealengine.com/t/some-trouble-with-my-timer/436334>\
**Category:** UI\
**Tags:** unreal-engine, Widget, Blueprint, question, calls\
**Created:** [October 25, 2018, 11:39am UTC](https://forums.unrealengine.com/t/some-trouble-with-my-timer/436334 "2018-10-25T11:39:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Betag](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Betag](https://forums.unrealengine.com/u/Betag)\
**Post date:** [October 25, 2018, 11:39am UTC](https://forums.unrealengine.com/t/some-trouble-with-my-timer/436334/1 "2018-10-25T11:39:42Z")

</div>

I’m making a timer for my game and i’m having some trouble. I have a button pressed in a widget calling an event in the player character BP. I think the timer works fine its just that based on the click it only pings 1 time. i would like it to count down all the way to zero.

 ![257596-uten-navn-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/f/62f31cc95340883ce51a125612212d7dea1351a6.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 25, 2018, 11:59am UTC](https://forums.unrealengine.com/t/some-trouble-with-my-timer/436334/2 "2018-10-25T11:59:53Z")

</div>

- you do not need to cast here
- if this is a timer, where is the timer?
- if this is a timer, why is there a Delay?

* * *

A timer would look like this:

 ![257608-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/5/735494e99592eeda9c03bb4446dec6674cc47cc3.png)

A click starts the timer, it will subtract 1 every second from Total Time. If you wish to stop / pause the timer, promote its `Return Value` to a variable and invalidate or clear it. Alternatively, call the timer again with Time {0} to clear it.

---

<div class="post-metadata">

**Author:** ![Betag](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Betag](https://forums.unrealengine.com/u/Betag)\
**Post date:** [October 25, 2018, 12:48pm UTC](https://forums.unrealengine.com/t/some-trouble-with-my-timer/436334/3 "2018-10-25T12:48:16Z")

</div>

its hooked up to an event tick, that’s why i have the delay. i use the total time integer in my hud to display the countdown.  
I followed your method, waaaay better. Thank you so much!  
I would like the timer to reset to its initial value after the countdown so i can use it multiple times could you help me with this?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 25, 2018, 1:07pm UTC](https://forums.unrealengine.com/t/some-trouble-with-my-timer/436334/4 "2018-10-25T13:07:14Z")

</div>

> I would like the timer to reset to its  
> initial value after the countdown so i  
> can use it multiple times could you  
> help me with this?

Sure. That’s what I mentioned above:

 ![257610-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/e/25e7abc94f93ed5369c4eda144a7293918b09205.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 25, 2018, 1:15pm UTC](https://forums.unrealengine.com/t/some-trouble-with-my-timer/436334/5 "2018-10-25T13:15:16Z")

</div>

Or even experiment with something like this, looks better and is reusable:

 ![257611-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/d/b/7db9c26f99f2fe38e71989364cfbc1a16cf341dd.png)

Call _StartTimer_ (via a button click or anything else), gives a chance to set new _TimeRemaining_. Calling _StartTimer_ with 0 stops the timer. Calling Star timer with \> 0, restarts it.
