How could I make a real lift using Blueprints?

i can make a lift like this A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

but this tutorial just make a simple lift

i want make a real lift ,when i move towards the lift,it can open the door,then i can enter the lift

there are some buttons in the lift,when i press the button number “2”,the lift can take to the second floor;
when i press the button number “3”,the lift can take to the third floor;

if there are somebody konw how to do this,i hope you can tell me! THANK YOU!

A very simple lift that goes up and down at the same speed (no inertia/slowing):

  1. Create the lift as a box and buttons. I’m assuming the lift is 250 units tall.
  2. Assuming it’s an FPS game, Use “trace channel” or dot-product functions to determine which button the character’s looking at.
  3. Create three float variables: “CurrentFloor”, “FloorToGo” and “LiftSpeed”. The LiftSpeed is in floors, e.g. it moves 0.25 of a floor per second.
  4. If button 2 is pressed set “FloorToGo”=2.
  5. At every “event tick” check if “FloorToGo” == “CurrentFloor”. If True do nothing. If False , get the sign of FloorToGo-CurrentFloor, multiply it with the LiftSpeeddeltaTime and add to the CurrentFloor. Then set lift location to X=X, Y=Y and Z = CurrentFloor250.

Should be easy enough to create with a blueprint.

thank you very much,could you show your blueprints to me?,i really need it ,please!

Would be too complicated to show in screenshots. If you give me a couple of hours, I can build the actual thing with comments etc. and post it.

if you are not busy ,are you willing to do it for me?

I’m willing to do it for myself, then share it :wink:

thank you!

hi, have you finished the lift yet?

Hi,

I’m a beginner in UE4 and I just realised a complete and fully customizable lift.
Instead of posting my BPs (too heavy and too big) and “making the job for you”, I think it will be more beneficial for you to try by yourself (following some guidelines I give you), and ask then if you’re stuck somewhere.

First of all I referenced this tutorial as a base for my work.: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums .

What I needed in my case :

  • a lift cabin that can move up and down (on Z axis)
  • a sliding doors (2 doors sliding one to left one to right, n my case)
  • some buttons that my player can select and activate to choose the level destination.

Based on that, her are the steps I followed :

First step : building the sliding doors (see tutorial and adapt it to my needs - change the sliding from vertical to horizontal etc), I created a Class BluePrint named “SlidingDoors”

2nd Step : Create a new class BluePrint (mine is called “Elevator”) - Inside it, first I build the basic displacement up and down with only one level (move from 0 to 1 and reverse).

3rd step : Add complexitiy to Elevator, with multiple levels (in the testing phase, I just hard coded the destination level to ensure I go where I want)

4th step : Add the ability for player to select among five buttons (I posted a simplified BP just of this part here Differentiate a particular element of the bluepint via raycast - Programming & Scripting - Epic Developer Community Forums to activate the lift.

Once this part works as I wanted, I added the doors by adding my SlidingDoors BP as “Child Actor” of my “Elevator” BP.

5th step : Adjust my Elevator BP, to play the open and close doors automatically when elevator reach the destination. Add a button specifically to open doors. Disable player input when the lift moves, etc…

6th step : more aesthetics and design. Add ability for designers to change any mesh and material for the different parts (doors, doorsframe, cabin, buttons, light etc…)

Hope this will help you to achieve what you want,

Cheers

I’m having mega trouble with this as well. I have followed the tutorial on the wiki to understand the idea. But I haven’t got a clue on how to implement multiple levels with BP. Did you ever get this done if so could you give me some pointers please?

I worked through alperenakyuz’s solution and it’s fantastic. It does have one important caveat, though. Make sure your default current floor and destination floor values are at 0. It doesn’t matter what floor it is as long as the value is 0.