Hello.
I need some help with a signal I'm trying to make to an instanced scene. Here is my scene called cutscene_001:
extends Node2D
func start_cutscene()
print("It works.")
The above scene is not part of my MainScene scene. I wish to load it on command and then signal it. Here is a snippit from my MainScene scene:
func cutscene_start():
var cutscene = load("res:///cutscene_001.tscn")
var cutscene_001 = cutscene.instance()
add_child_below_node(get_tree().get_root().get_node("MainScene"),cutscene_001)
print("We loaded a scene...?")
print(cutscene_001)
$MainScene.connect("start_cutscene", cutscene_001, "start_cutscene")
The print of cutscene_001 shows [Node2D:1240] in the output, so I'm loading the scene (I think) but when I try to make the connection from MainScene to cutscene_001, I get:
Attempt to call function 'connect' in base 'null instance' on a null instance.
I've tried various methods of things but I can't get my MainScene to start the start_cutscene from the instanced cutscene_001 scene.
What am I doing wrong here?