it says that it has an invalid assignment of property or key ‘text’ with value of ‘string’ on a base object of type ‘null instance’ (was following a tutorial)
extends Control
@onready var _dialogue : Label = $Text
var _typing_speed : float = 60
var _typing_time : float
func _ready():
display_text("lalala")
func display_text(text : String):
_dialogue.text = text
_dialogue.visible_characters = 0
_typing_time = 0
while _dialogue.visible_characters < _dialogue.get_total_character_count():
_typing_time += get_process_delta_time()
_dialogue.visible_characters = _typing_speed * _typing_time as int
await get_tree().process_frame
Your _dialogue variable has a value of null.
Which most likely means that when you try to assign the $Text node to that variable, it can’t find a child of that name, so the variable remains a null.
@onready var _dialogue : Label = $Text
You either have a typo in the name, or your node is somewhere else than a direct child of the node you’re running your script from.
Show a screeshot of your scene tree if you can’t find the rootcause yourself.