Multi Room Lever Door System

I am working on a project that includes puzzles, several of them including opening a door with a lever. How could i do this where I could reuse the blueprint in a different room and not affect all doors.

for this U need a class BP

The is really simple to do, in fact this is implemented in the content example, just check out the button.

In the content example you have the same button used all over for different examples.

The proper way to do this is create a variable in your “lever” blueprint of type object (reference) and name it “DoorToOpen” or whatever you like, then make this variable editable (click the small eye icon next to it).

Now place your lever in the scene, and if you looks at the details property of your lever in the scene you will find a variable named DoorToOpen, select the color picker icon next to it and then pick whatever door you want it to open.

If you know you want the lever just to open doors, then in the first step instead of selecting your DoorToOpen variable type as object, choose your door BP it’s easier to implement.

However if you want this lever to interact with different objects, then you should keep it as object or whatever BP class you have as parent for all intractable objects. But then you need to create an Interface, and implement it in blueprints you want the lever to implement with. That way you can make your level call the interface you created no matter the type of the object you created, and each object can react differently.

Here’s link to more info about interfaces:

Also here are some images of how to create the variable, in my case I chose a camera type variable, but you can pick whatever variable type you need.

I hope this helps :slight_smile:

Thank you. I really appreciate it.