how to connect a button to a door

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

So I want to make a button/lever that can turn on stuff like platforms, lights, doors, etc.

The question here is, how do I connect these elements, if I instanciate 5 buttons, and 5 doors how can I do the relations here.

What I have in mind is something like, the button have an export variable called partner or whatever, and when the player activate the button run something like partner.start(), so I can drag in the editor the door or platform into this variable, but didnt find how to do it.

:bust_in_silhouette: Reply From: Panagiotis Halatsako

Check groups and get_tree().call_group() functions.

You have one group of locked doors and then each door might have a “color” so on the func called by call_group could implement different actions.