extends Control
onready var dialogue_box = $CanvasLayer/DialogueBox
var playing_intro : bool = false
func _ready():
playing_intro = true
if !dialogue_box.running:
dialogue_box.start()
And i try to change AutoLoad name, but nothing happened. My solution is not to use the AutoLoad
Script
s do not come with a scenes attached.
So when you Autoload your Script
it won't come with the other Node
s you had in the scene where you designed it.
In this case you are trying to access $CanvasLayer/DialogueBox
which is not there because the Autoload is the Script
not the scene.
But scenes can have Script
s attached.
So add your scene (the .tscn
or .scn
file) as Autoload.
Then it should work.