[Brackey tutorial] Text label not getting updated by program

Godot Version

4.2.2

Question

Things to note:
*making my first game from Brackeys tutorial on youtube
*debugger has no errors

Problem:
During the “score” section of the tutorial (https://youtu.be/LOhfqjmasi0?t=3958) Brackeys places a label aimed to show the number of coins collected by the player, which increases each time the player collects a coin.

My problem is that the X value of the coins inputted in the label does not increase ingame. It remains “You have X coin” same as I inputted it in the label, as if the program isn’t working.

Here are some pictures for assistance :

image

image

image

any help is appreciated

Thanks in advance

It should be:

score_label.text = “You collected " + str(score) + " coins!”

2 Likes

Agree with @octopuddle

Just a tip to avoid issues like this:

Assign types to all variables (there is even a setting in Godot to enforce this).

Then the editor would have thrown an error when you tried to set “score_label” (which is not a string) to a string value, “you collected blah”.

Instead of getting no immediate error highlighted by the editor.

Not using types is quicker and easier to play around with, but runs slower and is harder to debug.

It is fine to not use types (I frequently do not for small projects).

But if you get stuck, go back and start adding the types to the variable declarations and see if it starts throwing an error.

1 Like

It works ! Thank you veru much !

thanks for the advice, i will implement it !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.