Hey Llenucs,
I don't know when you are create the instances. You should keep in mind that the _ready()
function is done from bottom to top in your tree, from child to parent. Don't know how your structure looks, but this could be one problem. On the other hand you could just call the cameras connect_to_nodes()
function each time you add a new node. Like this:
# Camera-Script
...
func connect_to_nodes():
for node in get_tree().get_nodes_in_group("Players"):
connect("shake", node, "do_shake")
...
# Another script
...
func instance_scene():
var new_scene = Myscene.instance()
add_child(new_scene)
$Camera.connect_to_nodes()
The problem is that this would reconnect all nodes over and over again. So it's not that useful and I would recommend to just connect the nodes when they are instanced:
func instance_scene():
var new_scene = Myscene.instance()
get_node("SomeNode/MyCamera").connect("shake",new_scene, "do_shake")
add_child(new_scene)
Is this what you were looking for or did I understand you wrong?
Good luck,
Jowan