|Topic was automatically imported from the old Question2Answer platform.
I have nodes within a scene that I have referenced through onready vars. From my understanding using the onready keyword is effectively the same as initializing the variable within the _ready() function. To my knowledge, in the tree load in tree order then once all nodes are loaded the _ready() function of the main node in the tree runs. I do not understand how the nodes are not being found if this is the case given the screenshot here:
I assume the script in the screenshot is intended to be connected to the top-level
GameHandler node, but are you sure that’s the case? I see other nodes in the scene tree with attached scripts…
Assuming the above script is attached to the top-level node, are you sure it’s not unintentionally attached to other node(s) too?
On the surface, I’d expect the code to work as you intend if the script is attached to the top-level node (and only to that node)…
jgodfrey | 2020-10-25 16:12
The selected script is for GameHandler which is attached only to the GameHandler node. Originally I had Map as an instanced scene but I made it a whole part of the GameHandler trying to fix this.
Edit: Also I was originally using the “$” syntax to grab these nodes, which also in the editor finds these nodes. That’s what bothers me the most is that it shows me it can see the nodes in the hierarchy but it isn’t finding them at runtime.
Edit2: Even running the scene independently (Instead of the main scene) causes this behavior.
sHerrmann | 2020-10-25 18:50
Is it possible to make the project available for review?
jgodfrey | 2020-10-25 19:01
Edit: There’s probably some things not working as intended or not implemented yet because I was working through a couple of systems. This just doesn’t make sense as to why the onready nodes aren’t there at runtime.
sHerrmann | 2020-10-25 19:05
That link leads to a 404 (page not found)
jgodfrey | 2020-10-25 19:13
sHerrmann | 2020-10-25 19:14