Directly to business…
How can i keep a var increasing when the player is not playing… android… if not possible
so second question how can i calculate the time between replaying the game and being idle… and what happens if someone force stop the app will it still work…ty
plz help :(:(:(
Someone please help…Please
Just calculate based on Time()
How to calculate the time between application close and reopen… Help!!! Plz
You will need to get and store the date.
Best the best way to get the date remotely (on your server), then whenever the player starts anything that needs a time, set that time on the server and you can just do the math to get your delta. (you can do a count down on the app, just verify it occasionally.)
You could also do the same using PlayerPrefs, just less secure. For that you can get the time/date using:
DateTime() : DateTime Struct (System) | Microsoft Learn
You can either store the times for events and calculate from there. If you need the time since close, you will need have the server record when the connection closes, or if you are doing it locally, just save the current time every few seconds or so.
Thanks! I’ll just save it in player prefs
because i don’t really want it that secure… and I’m not making a game where people have to wait for days and months and IAPs… Thanks