How do I get path/node obj from the signalling node for VS?

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

I am making a menu system where I change visibility of various sub-menus with button presses via the VS.

I have noticed that I can have multiple buttons give the same signal to the VS (I duplicated my “Return to Main Menu” button and it also duplicated the signal link with full functionality).

I want every signal call to result in setting visibility of the parent (container) of pressed button to false.
This way I dont need to copy the script for each sub-menu return button call.
It currently looks like this:
enter image description here

As you can see, I can’t find a proper way to link the signaller obj to the Button.get_parent() function.

How can I get the node object from the signalling node?
I need the object to be a universal link just like the function call is universal to all duplicated return buttons.

:bust_in_silhouette: Reply From: rossunger

I think the best way to do this is:

  • have this script attached to the buttons themselves, and then have a variable that is a reference to the menu that you wish to hide.

To achieve what you’re asking:

  • have a separate script in each button that then calls this script when clicked and passes “self” as a parameter.

I went with the suggested solution, thanks!
If you have some time, please explain how to pass “self” as parameter through the VS, I couldn’t figure that out.

darthsmart | 2022-02-05 21:45