How do I open a door with multiple switches?

This is the simplest method I can think of:


On the switch, make sure to make the player unable to un-interact with it. Make it a one-way interaction.

In the door blueprint, make sure to have an array of switches that it’s linked to, and a bool for whether the door itself is open. Make sure associated switches array is visible so you can set it in the level editor.
image

As well as that, also have a bool in the switch bp that records whether or not it’s activated.
image



The actual action of this happens on tick in the door blueprint.
image

First, we go through a do-once node- this is reset everytime the door doesn’t open, so the door will only open once. You wouldn’t want a door opening animation to start every frame that the door is open.
image

Next, we set Open to true. It’s easier to assume true with this node and set to false if it isn’t rather than assume false and set to true.
image

After that, we go through all the switches associated with this door, and check if any are NOT activated. If any aren’t activated, set open to false, and reset the do-once node.

Finally, after the for each loop has completed, we check whether the door is actually now open. If true, do whatever you want to happen when the door initially opens.




Here’s the entire function: