How do i record the time taken by the player to survive the level?

HI, Myself Soham.
Actually, I am developing a game for much time but I am stuck on a problem for a long time here.

What I want is the timer which will look after how much time did the player took to survive the level until the game is over. I have created the time tracker but the problem is that I want to record the time when the player fails to complete the level and show it on the stats screen.
Just wanted to know how can I do that.

Please Help…
Soham

You could start a timer at the beginning of the level and at the end over the level get how long it was running and display that.
You could also have a looping timer that every second adds + 1 to a variable and display that at the end.

Gdev also has built in expressions to get how long the scene has been running (TimeFromStart())

Multiple ways to achieve this :slight_smile:

1 Like

You can store variable Time in storage at the moment of death player. After that read variable from storage at any scene you want and show it.