Godot Version
4.2.1 Stable
Question
My code when I call the display_message() method i crashes with the error:
E 0:00:01:0212 MessageManager.gd:5 @ _ready(): Node not found: “CanvasLayer/MarginContainer/Panel/MessageText” (relative to “/root/TutorialLevel2/MessageManager”).
heres the code for the MessageManager:
extends Node
signal message_displayed
@onready var message_text = $CanvasLayer/MarginContainer/Panel/MessageText
@onready var message_audio = $MessageAudio
@onready var message_ui = $MessageUI
func _ready():
message_ui.hide()
func display_message(message: String) -> void:
message_text.text = message
message_ui.show()
message_audio.play()
await get_tree().create_timer(0.5).timeout
message_ui.hide()
message_text.text = "message"
message_displayed.emit()