danny
1
Godot Version
4.3
Question
i’m watching a tutorial by BornCG on how to make a coin counter
var coin_num = 0
func _ready():
$CoinNumber.text = String(coin_num)
coin_number is the name of my label node
when i use this code i get the error “nonexistent ‘string’ conductor”
You could use the str(coin_num)
function
hexgrid
3
If the name of the node is coin_number
then you should use:
$coin_number.text = value
The name after the $
needs to match the case/spelling of the node name.
That’s an old Godot 3 syntax. In Godot 4, use str(coin_num)
.