A door that opens with clickable button



hi, I want the door to be opened after I click the blue button. but after I click the button and it moves a bit the door does not rotate. can anyone help? I made a door in another project that opens with a button but the button was not clickable, but it was triggered using begin overlap.

You only check once during begin play if the button has been pressed.

Create an event dispatcher inside of the button. Then once it’s timeline “blue button time” has finished call the dispatcher.

Inside of the door on begin play after getting the reference to the blue button pull out a pin from it’s variable and bind to it’s dispatcher (it will create an event after the binding with a red line connecting it)

Move the rest of the code (branch, timeline and rotation) to this newly created event.

button

door

Though it might be better to just expose the button reference variable and set it in the scene.
You can then have more than one button and door and reuse it.

1 Like

Thanks! as a newbie learned 3 things from your answer!

1 Like

Glad I could be of help

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.