Download

[HELP] Check how long player has been offline

Hey, I am currently developing a life simulation game and I want a feature that whenever the player has exited the game, the player will still earn money while being offline. When the player goes back into the game, a widget will display on the screen informing the player on how much money they have earned while being offline. I hope this kind of feature works in UE4 and will be happy if someone knows how to accomplish this.

the PlayerState is not destroyed after the player Logout, it is set as inactive. And when a player logs in it tries to relink the playerstate with the controller.

Inside the GameMode.h l.205 you have this method:


/** Attempt to find and associate an inactive PlayerState with entering PC.
* @Returns true if a PlayerState was found and associated with PC. */
virtual bool FindInactivePlayer(APlayerController* PC);

My bet is trying to override the PlayerState method ReceiveOverrideWith in blueprints, which is called when a player state is relinked to a playercontroller