Getting the root node from anywhere

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

To reach a node higher 1 order I use
get_parent().get_node()

But when I call this from deeper node levels it doesn’t seem to find the parent.
How do I get to the root node from anywhere?

:bust_in_silhouette: Reply From: lowpolygon

I am assuming you want to get the world/root node

This should give you the root node

 get_tree().get_root()

get_tree().get_root().get_node("node_name/path")

Will get you any node provided you know the path