0 votes

Hi. I'm having trouble with the timer and label nodes, please help.

I have a timer in a scene. I want to create another scene to hold a label node which will display timeleft. I've created the label node but don't seem to be able to pass the timer countdown into it. I've tried getnode to fetch the timer from the other scene into the label node but I keep getting errors. What is the best way to create a label node with a countdown?

asked Jan 13 in Engine by Macryc (44 points)

1 Answer

0 votes

How I would personally do it, is add the timer to the label node, and in the script to make the countdown timer add set_text(str(minutes) + ":" + str(seconds) + ":" + str(milliseconds)) to make the label node display the numerical contents of whatever my variables were for the minutes, seconds, and milliseconds. See if that works?

answered Jan 13 by Rotsuoy (20 points)

Yea this is the simplest way to show a timer I guess but in my case the timer I have in my level scene has all sorts of functions (like you can increase or decrease it by a value depending on what happens in the game). The timer does some things in the game itself therefore I am really keen on picking up the data from this particular timer, not just any timer.

UPDATE: I've figured it out and it was a rather silly mistake on my part. Get node did work for the timer, I just forgot to instance the label scene! duh

That's the nature of coding for you. 9 times out of 10 it's something you totally forgot to do borking up everything. lol

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.