How to get income after minimizing the game?

Hey! I’m making a passive income clicker. During the game, every second, real time and income variables are recorded in the vault. After the game turns off and starts again after a while, I get the last session time and income variables from the storage through the “At the beginning of the scene”. I subtract from the current time - the time of the last session, get the second of my absence in the game and, roughly speaking, multiply it by the income of the last session of the game. This is how I get passive income in the game. And it works when the game is off, but doesn’t work when the game is minimized. I tried minimizing windows, but that didn’t help either, but maybe I did something wrong. Tell me, is there any way to load variables from the archive after the game is deployed?

Create a Variable called “LastTimeCheck” and set it to the current time when the game starts.
Everyframe check to see if the difference between the current time and the LastTimeCheck is greater than 1 second.
If so → You’ve detected a time gap, so do your logic to update the passive income based on the time since LastTimeCheck
Update LastTimeCheck to current time.