I’ve recently looked for information on how to setup a match countdown clock like you would see in a CTF game or Sports Game and came up with not-so-elegant results.
Let me post my solution.
- Setup a Variable in Game Mode called MatchTime as Interger, this would be Minutes,
- Setup in Gamestate it takes that converts it to seconds and then works with it.
- Set the Display output of the time after its manipulated to replicate so a Widget can display it to all clients.
[Event Begin Play]
[Function in GameState called on Tick with a delay of 1 second.]
(note forgot to hook up one boolean oops! :P)
[Widget Construction to display time Remaining.]
[Widget Get Time to display]
[Example in game normal time, which is ticking down.]
There are some game specific booleans in this example to deal with overtime and end match state. I am wondering if anyone has better ways of accomplishing this? I hope someone finds this useful as i might have.