Null instance for dialogue box

Godot Version

4

Question

it says Invalid access to property or key ‘process_frame’ on a base object of type ‘null instance’ and another part says the parameter “data tree” is null


@onready var _dialogue : Label = $Text
var _typing_speed : float = 20
var _typing_time : float

func _ready():
	display_text('maam,... E.c..se..me.... w....ait....')
	
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
		

sounds like your display_text is run on a node that is being deleted, removed from the tree, or never added as a child of anything

I just don’t know where i went wrong because i have another scene just like it with almost identical coding and it works

OK i figured it out the problem was the quotation marks, they were ’ instead of " after i changed that everything worked!