+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.

in Engine by (39 points)
edited by

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)

by (29,034 points)
selected by
+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.

by (108 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.