0 votes

So I found this video. I don't know if I should use Label or RichTextLabel as a "mother" node. With both options 0:0:0 is displaying but the counting doesn't start. What should I do?

If you have any other solution it will also be awesome.

Also I would like the timer to stop when player collects for example 10 coins and display it.

Godot version v3.2.3
in Engine by (15 points)

1 Answer

+1 vote
Best answer

It doesn't matter if you use a Label or RichTextLabel as a parent node. They should act the same in this case. If the counting doesn't start, did you connect the signal properly? And did you check "autostart" for the timer as well?

For the timer to stop when the player collects ten coins, you should have the node that manages the player's inventory send out a signal to the timer that stops it. I'm not sure what you mean by "display it", though. If you mean display the timer, as long as you don't hide the text node it will be displayed. If you mean the number of coins, add another text node and update the number in it similarly to how the timer's text is updated, only except when a coin is collected and not every millisecond.

by (7,190 points)
selected by

Thanks for your answer!
I did everything as in a video I linked in a question. I did check the autostart and did connect the signal (like in the video). However, I don't know if it isn't working because it is quite an old video and something can work differently (?).

I recreated the tutorial in the current stable version of godot and it still works. Perhaps you can show me your code?

I got to know why it doesn't work. I didn't notice that in the video ready() -> void: is changed to _process(delta):. I fixed that and now it works. Thanks for help :v

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.