A problem with referencing on an instanciated node

4.4.1.stable

I’m having some trouble with node paths and referencing on an instanciated node.
Just recently all was well - i believed i referenced the paths by the $../../[nodename] method, but now the node fails to find the nodes in the scene into which i’m instanciating it.

Currently, the node paths look like this:
image
And, on start, all three fail:
image
I should add that i have tried different methods, including trying to reference the nodes by their unique names, the node still can’t find them.

For reference, this is the setup of the scene into which i’m instanciating the node - specifically into the HandContainer.

Would appreciate if somebody could shed some light onto what is exactly happening here.
Thanks!

The error states the path is /root/GameScene did you add this game scene script as a Global? If you added the script as a global then it will only create the script node, not it’s children you must add the scene as a global for it’s children to be loaded to. But loading a “GameScene” as a global seems odd, maybe that’s a bad idea in the first place.

1 Like

Correct me if i’m wrong, but i read it as you are asking if the GameScene is an autoload?
If so - then no, it’s just the root node of the scene i’m currently loading on start.

You try to get a node relatively from your letter node inside the handcontainer.
So the path this code is looking for is /root/GameScene/Containers/HandContainer/Letter/Containers/HandContainer

Use $“/root/GameScene/Containers/HandContainer” instead or just use get_parent() for the HandContainer.

1 Like

Thank you!
Finally got it figured out.