# How to make a clock counter?

**URL:** <https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761>\
**Category:** UI\
**Tags:** hud, timer, unreal-engine, UE4, question, UMG\
**Created:** [January 29, 2016, 12:30pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761 "2016-01-29T12:30:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_29db4c0f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_29db4c0f](https://forums.unrealengine.com/u/anonymous_user_29db4c0f)\
**Post date:** [January 29, 2016, 12:30pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/1 "2016-01-29T12:30:10Z")

</div>

I have a mini-game in which you must consider how long takes the user to pass through a level. I’ve seen a lot of tutorials on how to implement a countdown based on sth, but I want a simple digital clock that indicates the user how many minutes, seconds (and maybe milisecs) he is spending in his level.

I implemented a HUD like this:

 ![76468-sin+título.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/4/9746f45168ec1eff187d704f3be49caab52089dc.png)

And here you see my variables:

![76469-sin+título.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/4/9243584ceb8fd914e94ac0d3bd9ee38251a816fc.png)

I didn’t find any idea on how to implement that time count… Any help will be really grateful!

---

<div class="post-metadata">

**Author:** ![CelestialCel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CelestialCel](https://forums.unrealengine.com/u/CelestialCel)\
**Post date:** [January 29, 2016, 2:07pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/2 "2016-01-29T14:07:10Z")

</div>

Hey Sonia,

There’s multiple ways you can do this.  
One way to do it is, get event tick.

Plug in a float value + delta seconds(time since last frame), put that into a timespan variable and output the minutes,seconds and hours.

Here’s an image. Hope it helps!

 ![76496-time.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/e/1eec5b0c5451af932a0a64b9dd8ad52ff977ddf2.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_29db4c0f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_29db4c0f](https://forums.unrealengine.com/u/anonymous_user_29db4c0f)\
**Post date:** [January 29, 2016, 3:04pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/3 "2016-01-29T15:04:43Z")

</div>

My problem is more on where to put that even tick… Because my HUD blueprint (actually it is a Widget Blueprint), doesn’t have that event. Should it be in my First/Third person character blueprint?

---

<div class="post-metadata">

**Author:** ![CelestialCel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CelestialCel](https://forums.unrealengine.com/u/CelestialCel)\
**Post date:** [January 29, 2016, 3:07pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/4 "2016-01-29T15:07:23Z")

</div>

could do in character and expose that variable to your widget bp

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_adcc0ac7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_adcc0ac7](https://forums.unrealengine.com/u/anonymous_user_adcc0ac7)\
**Post date:** [January 29, 2016, 3:24pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/5 "2016-01-29T15:24:49Z")

</div>

One thing to consider is you’re not really wanting to measure how long the widget has been on the screen. You’re wanting to measure something like “how long has the player been active” or “how long have we been in this level.” Thinking of what exactly you are measuring should give you a good hint about the best place to put this logic. The UI element is just displaying that number, not calculating it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_29db4c0f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_29db4c0f](https://forums.unrealengine.com/u/anonymous_user_29db4c0f)\
**Post date:** [January 29, 2016, 4:01pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/6 "2016-01-29T16:01:36Z")

</div>

Ok, it works perfectly! Now I’m trying to bind it to my timer in my HUD… -\_- I’m a bit newbie sorry…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_29db4c0f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_29db4c0f](https://forums.unrealengine.com/u/anonymous_user_29db4c0f)\
**Post date:** [January 29, 2016, 4:06pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/7 "2016-01-29T16:06:48Z")

</div>

Oh, it can’t be done in my character, as the character can die, so I used the level blueprint to print the string as I want to measure “how long the user is in a level”. Do you think it is a correct place¿

---

<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:** [January 29, 2016, 4:31pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/8 "2016-01-29T16:31:44Z")

</div>

Either in the level blueprint or if you use a game mode/game state blueprint you can have the counter going independent of the player. You can find more information on these here:

[https://docs.unrealengine.com/latest/INT/Gameplay/index.html](https://docs.unrealengine.com/latest/INT/Gameplay/index.html)

---

<div class="post-metadata">

**Author:** ![RIFFF](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rifff/32/700067_2.png) [@RIFFF](https://forums.unrealengine.com/u/RIFFF)\
**Post date:** [December 7, 2022, 10:32am UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/9 "2022-12-07T10:32:01Z")

</div>

Thank you

---

<div class="post-metadata">

**Author:** ![ahmadbravo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ahmadbravo](https://forums.unrealengine.com/u/ahmadbravo)\
**Post date:** [November 12, 2024, 7:17am UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/10 "2024-11-12T07:17:10Z")

</div>

I prefer not to Use Tick. This Recursive function works better for me.  
[Count Down Timer posted by ahmadbravo | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/suo7fmwi/)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/5/9c54957be66e16f41b98b1166837457d4871819c.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:** [November 12, 2024, 12:43pm UTC](https://forums.unrealengine.com/t/how-to-make-a-clock-counter/345761/11 "2024-11-12T12:43:16Z")

</div>

> [@ahmadbravo](#):
>
> I prefer not to Use Tick. This Recursive function works better for me.

There’s no need to do any of this - there is a timer that counts time and spits out updates at intervals you desire. 🤷
