Can'd find the correct syntax to convert this: get_node("../Button") to $../Button

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

Just trying to use the shorthand $ for get_node but the node I want is not a child. Can I still use $ in some way to move to another branch?

in the working node this is fine:
get_node(“…/Button”).connect(“pressed”, self, “_Button_Pressed”)

The Button is a sibling not a child so $Button does not work.


:bust_in_silhouette: Reply From: njamster
$"../Button".connect("pressed", self, "Button_Pressed")

Thanks again!! But I did change it to:

$“…/Button”.connect(“pressed”, self, “_Button_Pressed”)

Needed the quotes.

thinkingfield | 2020-02-09 16:59

Yeah, sorry, I messed up the path. I corrected my answer.

njamster | 2020-02-09 17:02