How to open a door when player clicks a Cube?

Hello, i want to make a FNAF game but i don’t know how to make a door that will open when player clicks a Cube (button).

is your cube a button (widget) or a blueprint actor. either way its pretty simple, if its a widget then you just need to use the on click event within the widget, but if its a blueprint actor then theres a few more steps which i will outline below.

ok so the first thing we need to do is to enable the set show mouse cursor and set enable click events. this can be done in the player controller or from the character but you will need to get the player controller as seen in the below picture.

next you need to make your door blueprint actor and create a custom event named something like opendoor. this custom event will be where all of the script for the actual opening / moving of the door is (this step is not show in the pictures).

now the last step is to create the switch blueprint actor. the first thing you will need is a reference to the door that you want to open, the easiest method for this in my opinion is to create a variable and make its type the class of the door bp you created in the last step. you also want to make this variable public by clicking the little eye icon, this way we can edit the value when the blueprint is placed in the level. now that we have the reference drag the variable into the event graph and make it a get. drag of the variable and search for the custom event that you made in the door bp (we made it the type of the door bp so we dont need to cast). now right click the graph and search for on clicked and you will see “event ActoronClicked” . once you have the necessary nodes just connect them together as seen in the picture below.

244031-capture1.png

if you dont know how to make a door that opens let me know and ill show you how. also if you have questions let me know and ill try to answer.

Thanks worked and sorry for late answer.