# Money Every Minute System?

I'm making a 2D sandbox tycoon in UE4. I haven't started the money system yet, but I was wondering how I could make a money system that gives you a certain amount of money per real-life minute. Then, I want to connect this system up to some text so that the digits go up by whatever amount each minute.

• What is your actual problem? The "getting money every minute" or do you also want to do this when the user is not playing? Please clarify May 6, 2019 at 7:03

If you only want to do this while the game is running you can use the timers the engine provides.

Brief summary (Current UE Version 4.22):

• Create a method which should be called after the timer ends (e.g. rewardCallback)

• Add a Blueprint node called 'Set Timer by Function Name'

• Set the function name in the blueprint node to be the name of the method created in the first step (i.e. rewardCallback)

• Make sure the node gets called at least once (or more often if you don't loop the execution of it)

If you want to extend it such that offline time also gets taken into account then you might want to simulate the time the player was away.

E.g. In an extremely simple case:

Delta_away = time_now - last_logoff_time //in minutes since 1970
Reward_away = reward_per_minute * Delta_away


Unreal offers several built in timers and, depending on your needs, I'd suggest either GetTimeSeconds and GetRealTimeSeconds. Both do the same job but GetTimeSeconds gets paused when the game is paused whereas GetRealTimeSeconds does not.