#3D FPS Timer/Clock

32 messages · Page 1 of 1 (latest)

hybrid merlin
#

there's a module for working with date and time: https://docs.godotengine.org/en/stable/classes/class_time.html#class-time-method-get-datetime-string-from-datetime-dict

save to variable system unix time on timer start, then whenever you need to update the timer visual calculate the difference between current unix time and the saved value, you can get a time string or time dict from the resulting integer to generate a string for the timer formatted as you like.

the timer visual itself then can just be a label/richtextlabel in a canvas layer whose text you update periodically

stuck yew
#

Ahh too complicated, I just needed like a 10 minute counter

#

I get what you mean tho

hybrid merlin
#

it's pretty simple and I don't think it makes much difference how big timer

stuck yew
#

gdyeet gdthumbsup Still dont know how to make it tho

hybrid merlin
#

start by reading the docs i linked

#

im assuming you at least know how to change text of a label

stuck yew
#

Yes I have read them but they dont exactly help me with the code I need to use. These are just basic snippets of how to use time

stuck yew
#

No idea how to make such code

hybrid merlin
#

it doesn't have to be self-updating

#

you can run it in _process() of a main scene as well

stuck yew
#

What

hybrid merlin
#

you know about having code execute every frame, right?

#

_process() and _physics_process() methods

stuck yew
#

Nahhh i'm kinda lost

hybrid merlin
#

you didn't do the step by step tutorial in docs?

#

you should do it as a minimum, ideally do some of the follow up tutlrials as well

stuck yew
#

Yeah I get it I just dont know how to make a exact code with the time thing

hybrid merlin
#

exact?

#

you should first learn the basics

stuck yew
#

Bruh

#

I know some basics but I just need the code.

hybrid merlin
#

methods like _process() are part of the basics

stuck yew
#

I just needed one thing

hybrid merlin
#

there's a tutorial here that uses delta, but you should really learn how to make things yourself https://youtu.be/irI4ebb0JJ0

GitHub - https://github.com/trolog/GodotStopWatchAdanced
Discord : https://discord.gg/QnNu6FU​
Appreciated never expected : https://www.buymeacoffee.com/rungeon
Twitch : https://www.twitch.tv/ste_makesgames
This might not be the best way of doing it, but I couldn't find a decent timer in Godot that did Milliseconds, then I got carried away and w...

▶ Play video
stuck yew
hybrid merlin
#

yeah, well if you don't learn these things you'll be stuck like this

stuck yew
#

Ight