Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Ciavarie |
I have a Button inside a structure like this:
World > YSort > Player > Camera > CanvasLayer > Button
A script is attached to it and inside this script I try to reference the button by:var this_button = get_node("YSort/Player/Camera2D/CanvasLayer/CombItemButton")
inside the _ready() function
Whenever I start my project it crashes with the error message:
E 0:00:02.559 get_node: Node not found: YSort/Player/Camera2D/CanvasLayer/Button.
<C++ Error> Condition “!node” is true. Returned: __null
<C++ Source> scene/main/node.cpp:1381 @ get_node()
Button.gd:4 @ _ready()
Next I tried to get the button by.
get_tree().get_root().find_node(“Button”)
Unfortunately this holds the same result and as I just started with godot I am kind of out of alternative solutions I can come up with.
I would gladly appreciate any attemt to help me out.