Godot Version
4
Question
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