Implementing Time (and putting it in HUD)

So I currently have time setup in my gamemode but im not sure how to properly reference it to the HUD. I tried casting originally but I’m a bit confused on how to use casting properly sometimes. Here is how the time is setup and here is my HUD currently (but not complete because I don’t know how to go about this).

I also would like to know where I should properly setup my time to reference it. Should I keep it in the level blueprint? In the gamemode? Or elsewhere?

I would also appreciate any tips to condense some of the scripting

Okay so I managed to get it working and implemented into my HUD (understanding how casting works better now), but I noticed on the other client that time is just not present there.

GameMode exist only on server/host player and it’s not replicated at all for security reasons. You need to keep in mind that user is free to read (and manipulate! so watch out what you replicating from client) any data from memory of there machine, so all data that is replicated can be accessible to them with use of right software, even if they don’t see it in game. There other class called GameState which work kind of like GameMode extention which is replicated and it place where you should put any globaly accessable game stats.

Game Mode and Game State in Unreal Engine | Unreal Engine 5.1 Documentation (See bottom)

Same comes with PlayerController, this class exists in memory only of owning player machine (if im not mistaken) and server. Thats why there also class PlayerState created for each player.

Also you seem to implement timer in hardcore way with Tick, you know about timers right?

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/index.html

There nothing wrong with using tick to count time specially if you want to count time in different way, but using timers can save you a time and also it powered by native code so it can save up some performance.