+1 vote

If I want a timer in a game that is not impacted by a user changing their OS clock, how might this be done? For example, if I wanted to know the time in real life that has elapsed since an action was performed in hours or days. If I pull time information from the user's OS, then the user can adjust their clock as a "hack". This is something I would like to avoid incentivizing.

asked Jul 12 in Engine by Jack J (37 points)
edited Jul 12 by Jack J

2 Answers

+4 votes
Best answer

If you want to get time without using the OS, then I guess the only way would be to do an HTTP request to some server you trust in order to get that date.
Maybe websites like https://time.is/ have an API to do this?

However that would be a bit lame for a game to do that if it initially doesn't need internet connection (aka not multiplayer/no remote ads/whatever online)

answered Jul 13 by Zylann (14,838 points)
selected Jul 13 by Jack J
+1 vote

Well if you dont want to use os clock the only other way i could think to do this is to make your own clock in game utilizing delta in fixedprocess(). delta is the time between rendered frames.

answered Jul 13 by happycamper (99 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.