I am programmatically instantiating a scene with the player character. When this scene is instantiated I want to send a signal to the camera. The signal should set the player character to be the target of the camera.
This is the main scene structure
(instantiated scene will be here)
The new scene is instantiated as a child of the SceneSwitcher. This is SceneSwitcher script where I am trying to connect the signal from the instantiated scene.
var newScene = load(scene).instance()
newScene.connect("focus", camera, "setCameraTarget")
The instantiated scene is emitting this signal:
This is the function in the camera that I want to run when the signal connects:
print("camera set on: ", object.name)
target = object
Seems like the signal never connects because I never see the print message "camera set on: player".