Total time game played?

How do I get total time game played output to the log on quit?

In your GameInstance/GameMode/GameState class simply create a float variable called “timePlayed”

in the Event Tick of this class, add the delta Seconds to this timePlayed.

When quitting, simply print this timePlayed.
You may format this variable to seconds, minutes, hours and days.

Thanks for that Raildex, but could you please show me what you mean as a BP and could this be done simply from the level BP?

Create a blueprint from the GameMode/GameInstance/GameState class and do what I just wrote.
The GameMode atleast provides a function called “PostLogout” or something simlar(just search for “Logout”) that executes when the Player disconnects/quits the game.

A simple search on google would have given you this:

It clearly didn’t otherwise I wouldn’t have posted, but thankyou anyhow.

There is also this option, posting it here since this is one of the top hits:

2 Likes