- Home /
Question by
smashingy0u · Apr 01, 2014 at 02:47 PM ·
androidmobilememory
Unity run in background on android
Hello,
i want to create some sort of app which gives you a pet for example. Now i want its hunger value to go up over a time (even when the app is not open). because it can take a couple of hours before it is hungry. Is there a way to keep updating variables while the app is "closed" or determine in some way how much time has passed between the app was closed and reopened?
Thanks in advance! ;)
Comment
Answer by Slobdell · Apr 01, 2014 at 02:50 PM
Just store the datetime fido was last fed in a playerprefs variable. Then next time they open the app check what time it is and compare to the stored datetime
what would be the best/most efficient way to do this?
Your answer
![](https://koobas.hobune.stream/wayback/20220613141658im_/https://answers.unity.com/themes/thub/images/avi.jpg)