Right now I am trying to create a fairly complex lift and I’ve got no idea how to make it all work, some parts of Blueprints are difficult to work out and I’ve searched far and wide to no luck. And no the basic Lift tutorial I’ve read and I understand that and I want to do more. Also I want to do this in one Blueprint, so I can place multiple lifts around the level.
So this is what I want it to do in pseudo code as to speak.
Lift has two levels
on bottom button press check to see if lift is up or down
if lift is down then open bottom doors and lift doors
if lift is up then send down then open bottom doors and lift doors
on top button press check to see if lift is up or down
if lift is up then open top doors and lift doors
if lift is down then send up then open top doors and lift doors
on lift door button press close all doors, if lift is down then send up, if up then send down
on lift up, open lift doors, open top floor doors,
on lift down, open lift doors, open bottom floor doors
So that is what I want to do, basically have buttons to control the lift doors and movement plus be able to call the lift if it is up or down.
So far I’ve managed to animate all the doors and have the buttons glow when the player moves into a collision near the buttons, but what to do after that is beyond me.
you can search for using a vector variable as 3d widget, that you can define the start/end point of your lift, so it does not have to be just up/down.
so when the button is pressed, disable the button until your lift reached one of the end point. when button pressed, check which end point is further away, and set your speed and such to travel toward it.
You want to keep things generic. I would break it into three pieces: a door button, a level door, and the lift itself. Each one has a simple piece of logic attached.
Door Button: Has a button mesh and links to a lift and a level door. When you press the button, it gets the position of the level door and sends a message to the lift: go to door position. Set a flag on the level door to make it “active”.
Lift: Has a mesh. When it gets a message, it simply moves towards the correct floor (usually constrained to vertical motion) and stops there (possibly maintaining a list of future positions it has to move to). When it’s stopped, it opens its inner door. After a few seconds it closes its door, and moves to the next position or simply waits.
Level Door: Has the door mesh, a boolean flag, and a collision box. If the flag is active, it watches for a lift to collide with its box. Once the lift is colliding and has stopped, wait a second, open the door and sets the flag back to “inactive”. Wait a few seconds and close the doors.
You simply put a copy of all the door buttons inside the lift so you can move to any floor from inside the lift as well.
If you keep them generic, you don’t need a concept of “top door” or “bottom door”. You should have one generic door, one generic button, and one generic lift that you can instance and wire together to get the behaviour you need. Then they can be used for multiple lifts with as many floors as you need.
So I’ve been trying some ideas I’ve had and I’ve managed to come up with a working lift with a few minor issues.
So what I ended up doing or working out is how the Flip flop node can allow me to toggle the button between a open and closed state or up or down state.
With this I was able to have the doors open and close depending on whether or not the buttons are pressed and if the lift is moving etc.
So in this video you can see what I have managed to figure out.
However some issues remain:
Doors can be opened and left opened causing the FipFlop to break, if you go up another lift the doors go out of sync
Still haven’t got a good solution to close the doors if the player ends up not going in the lift would fix the above problem
This solution isn’t the best it is messy and could be better however I wouldn’t know where to start
This would work however this would this mean I would have to place each button and lift and doors in the level for every lift and wire each one separately? or is it possible to add a blueprint into the component of another blueprint? gah I don’t know I am confusing myself, this whole lift is one big headache
Okay so I’ve been tackling this lift for a good while now and I still can’t get my head around it…
I’ve looked and looked for examples even outside of unreal but the logic is still beyond me
So I took your advice CaptainScience and broke the blueprints down into four Blueprints. So this is what I have at the moment.
BluePrint 1: Doors - These door ways have a custom event that can be called to open and close them, pretty straight forward.
BluePrint 2: Button - These can be wired to the lift controller and also be defined to which floor the button should work with.
Blueprint 3: Lift - Has a timeline that lerps between two vectors to move the lift up and down. These are attached to custom events to either move the lift up or down. + this blueprint also has its own individual button.
BluePrint 4: Lift Controller - Brings everything together. At the moment it is possible to call all the events and essentially through logic control the lift, this is the part I’m stumped on. I’ve had it down before but it was too complex and there is probably a far simpler solution.
Anyone know of any hidden resources or examples. All it is I am aiming for is essentially a two floor lift.
Hello,
if i would do an elevator like that i would just set and use a variable : the z value of the lift to activate all stuff. I keep a few hours to try and i come back showing if i found a fair way to do.
You’ve just find an hidden resource : forum members who like finding solutions (success unlocked ^^ )
Well you will never believe it. I’ve actually managed to figure it out haha.
I decided to sit down and properly work it all out and its not the most elegant solution but it works. I will probably post a video at some point outlining how I managed to do it in the end, but I am still interested to see what results you end up with.
Coooooooooooool ! you solved your puzzle ! grtz ^^ The solution i am working on is the laziest one : one blueprint with all in to not have a hundred of interface or cast to do with elevator buttons and boxes. Overlaps in this bp and key events in level bp. I actually ignore timeline to use only set relative locs to have it working, then i’ll add them to have better look. i’ll show here if i succeed and thanks for the video/(tutorial if you can) to help community
then : Out -> if elevator is at same level : doors open if not elevator comes and doors open.
In -> Elevator goes to other level and doors open. (i made it boring for player as the door close fast and don’t let you come in, as it happens regularly irl ^^)
It was fun to try to find a solution, even not a perfect one, so thank you, i had a good time
In hope it gives you more ideas.
(You can let doors open and add an overlap box in the elevator to activate the closing for example)