Godot 4.2.1
I tried to use str() to convert a integer variable into a string and it didn’t work
I want to display data from an integer variable in a Label node, I tried using str() to convert it into a string, but it doesn’t seem to work. When I run the game it shows the following error: "Invalid set index ‘text’ (on base: “null instance”) with value of type ‘String’ ".
I don’t know if this is a bug with my version of Godot or something like that, if anyone can help me with this, I would be really glad.
I’m new to Godot and English is not my main language, so excuse me for any mistakes.
Here’s my example:
var integer_variable = 100
func _ready():
$Label.text = str(integer_variable)