+2 votes

How to show on a Label how much time from a Timer is left ?

Godot version 3.2.2
in Engine by (255 points)

1 Answer

+3 votes
Best answer

Assuming you have a Timer and a Label as top-level children in your scene, something like this should work:

    $Label.text = str($Timer.time_left)
by (12,290 points)
selected by

OK, thanks a lot.

To display time in minutes:seconds format, use:

$Label.text = "%d:%02d" % [floor($Timer.time_left / 60), int($Timer.time_left) % 60]
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.
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 webmaster@godotengine.org with your username.