Creating a Death Timer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Paul Wetzel

Hello! In my Gamemode, the player presses buttons that are scattered across the arena. The player has 5 seconds to get to the next button. If they manage to do so, the timer resets to 5. If not, the player gets a game over.

I wanted to start of simple by displaying the time on screen and killing the player when the timer reaches 0, but I´m not really sure where to start with this…Does anybody maybe know what I have to do?

:bust_in_silhouette: Reply From: Calinou

Use a Timer node to achieve this. Connect its timeout signal to a function that will kill the player, and call start() on the timer when the sequence begins. Set the Timer’s time_left to 5 every time a switch is pressed.