How to create a system that when I leave the game the time inside it keeps running

I’m making a game where I want it to keep generating “profit” or the time of a certain item keeps “running” even after exiting the game, for example, I planted a 15 minute vegetable and exit the game when I return 10 minutes later the vegetables are 5 minutes to go.

Have a look at the Date Time nodes:

349841-screenshot-2.png

When the player leaves the game, save current time to a save game object. When they enter the game, load the save game, read the saved time value. Deduct one from the other and you’ll get the delta of the time that has gone by.

1 Like

I tried it but with no success, do you know how I can save and load from time?

It’s a standard save & load like everything else. It’s just a single variable:

You will need to save game anyway.

1 Like