Game time

Anyone know how to implement a timer to show on the hud in blueprint ?

there are a few time related functions, but I’m assuming you want a timer that counts down?

If you make a new float (In this screenshot, it’s Time) and set it to a default value (let’s say 60), subtracting the delta seconds from event tick should make it count down from 60. You can hook it into a draw text to make it display, I’m not sure of an easy way to truancate the decimal point in blueprint though. If you want one that counts up, use the float + float function instead of the float - float.
This is all in a Hud blueprint:


You can see it here in game, it’s the pink 50.

There may be a better way to do this using the built in timer functions, but I’m not familiar with them, and this is how I remember doing it in c# when working with unity.

(Sorry, not sure how to take screenshots in the editor/attach them in the forum).

I’m sorry but, I’m trying to set this up as we speak and this picture does not help at all:

  1. What is EVENT RECEIVE HUD plugged into?

  2. What is DRAW TEXT connected to?

  3. What is the little blue and green dot box?

  4. How do I get TIME from the menu. When i search TIME nothing shows up.

  5. What is the three green dot box?

Please explain this graph!

1 and 2 = just plug draw hud into draw text in your HUD class, should work
3 = that box is float to string, try and plug that return value into “text” on the draw text node, and it should pop in there automatically
4 = time is a float variable he created. create a float and name it whatever, click in the graph and choose get
5 = 3 green dot box is float minus float

edit: If you don’t want the time to go below 0, stick a dirty clamp node on 'er

Trying to do this now, it’s asking for a Context. What would the context be?
EDIT: Found the bug with that, but nothing timer related is showing up on the screen, even though there’s a HUD being created.