Why doesn't can't I grab this node? Flummoxed.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nationality

OneDrive link to screenshot

I’ve done this successfully before. I have no idea why it’s not working now. What’s wrong with this?
As you can see from the screenshot, the node path is correct.
I feel like I’m doing something stupid, but I’ve tried so many times to get this to work. I’m out of ideas.

Thank you for your time.

:bust_in_silhouette: Reply From: GunPoint

Try get_parent().get_parent().get_node("Console");

It worked! But damn does that seem inelegant. Godot is strange when it comes to grabbing parent nodes. Wish there was a get_root() method, but it doesn’t look like it from the API.
find_parent(“TestingGround”).get_node(“Console”) also works.

nationality | 2019-04-21 19:18

There are get_tree() and get_root() methods but in earlier godot versions they were not working correctly (at least for me) and i still avoid them. I also avoid the dollar $ sign. I use it only when i need to grab children nodes.
The way I showed you is just logical, you need a child of the parent of the parent :)))

GunPoint | 2019-04-21 19:44