Delta1
(Delta1)
December 16, 2016, 1:50pm
1
How do I get total time game played output to the log on quit?
Raildex
(Raildex)
December 16, 2016, 1:59pm
2
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.
Delta1
(Delta1)
December 16, 2016, 2:13pm
3
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?
Raildex
(Raildex)
December 16, 2016, 2:40pm
4
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.
eXi
(Cedric Neukirchen)
December 16, 2016, 3:20pm
5
A simple search on google would have given you this:
Hi, I have been trying to figure out a way to keep track of playtime. I found that there is a timespan class that I thought might be the solution, but I can’t get it to increase by using the timespan + timespan function. It seems to always stay at...
Delta1
(Delta1)
December 16, 2016, 3:31pm
6
It clearly didn’t otherwise I wouldn’t have posted, but thankyou anyhow.
vbs
(vbs)
April 1, 2021, 12:14am
7
There is also this option, posting it here since this is one of the top hits:
2 Likes