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