Creating elevators that can be placed

Hey guys
I’m pretty new to blueprints, so I don’t really know all the functions you can use.
I have some trouble creating an elevator. I have tried to google it, but all the elevators I have found are based on matinee’s, creating keyframes in the world where the elevator platform moves to the created keyframe, BUT, the elevator I want to create is a pretty simple elevator, but something you can simply drag into to the world from the content browser, and with an object or a value you can put in, which determines where the elevator is heading when it is activated. If I put several elevators in the world, these values should not interfere with each other.

So basically, an object that will move to a specific point you have created when activated, and also a way to move it nack to the starter point.

If there is an easy way to create several floors, I wouldn’t mind having them mentioned, and I would also appreciate it if it is possible to add a button object, connect the button to the elevator, which activates it, while the button is its own object, which can be moved around the level without interfering whit the elevators position.


Hello CorbisHETB. Matinee’s are not bad to use for an elevator but it seems for your case you would like to set a location for the elevator to start and begin. In this case I would use the MoveComponent to node. Create an Elevator blueprint with really only one component, the elevator (mesh, skeletal mesh, object, etc). Since the location is relative in the node, it uses the relative location of each bp you place in the world so they don’t affect each other. Also, in the exec pins on the top, there is one to ‘start’ the elevator and one to ‘return’ the elevator. There is also a stop node so that’s handy if you want to use it.

You want to make sure to check the ease in and ease out boxes so it slows down towards the ends and speeds up in the center. The over time allows you to adjust the time it take the elevator to move from point A to point B. Hope this helps.

In this example I have here, the platform I have will start from wherever I placed it in the world (this is point A) and move up 1000 units in the Z direction (point B).

This would be one of the ways in which you can control which floor the elevator goes to. I’m assuming here that the elevator goes only up and down so that’s why I left the X and Y relative location at 0 and only change the Z location. make a float array for the relative Z location of each floor, in my case each floor is only 100 units apart which I tried to show in the bottom right of the picture as the default values. In the game you can ‘set’ the value of the variable PickFloor to select the array element (which floor it is) which sets the new location or destination of the elevator. Hope this helps.

Also, depending on what type of game you are making the button setup will be different (VR or touchscreen or fp etc). If you let me know what kind of button setup you would like I can try to help you with that.

Another method that you could use is a TimeLine node as well which will allow for more customization but it’s a little more difficult so if this one doesn’t work I can show the timeline can be used to drive en elevator.

Okay, I start to get the hang of it now, but I still have some problems with the event call. I want to have a seperate object which I can add to the level, and when the player (First person) looks at the object, a prompt shows up, most likely E. When the player presses this key, the event should be activated. So I guess I need to use Raycast for the prompt.

Since the button is its own object, I can also use this blueprint for other purposes than the elevator, for example door and lights. Its just a way for the player to activate something by a physical push. I do not intend to make this game VR compatible yet, so there is no reason to implement that.

In that case you would need to use a LineTraceByChannel and then used a BreakHitResult to select the things you want to use to trigger the event. After you make the blueprint or whatever it is you want to use, you can use an isValid node to check to make sure its that object. heres a video that shows how to use a LineTraceByChannel.

I’ve watched this and some other videos, but i don’t really get what I want. I can make the hit result give a return value if it hits the class my button is in, BUT I still don’t know how to connect the specific button and the specific elevator together to make the elevator activate. Since it searches for the class the button is in, any button pressed will give the exact same result. Do I have to put all the different buttons in different classes?

Hello there again Corbis. This really depends on how many instances if these elevator-button pairs your are going to put in your level. I’m sorry I don’t really have in mind what kind of project you are creating so it’s hard for me to say how I would go about it. If it is only one elevator then you can use create the interaction in the level blueprint with an event upon collision event.

In general I would cast it to the elevator upon hit of the elevator button.

In this example I created an event where I spawn an energy ball when my mouse cursor is over an enemy. I did this by casting the hit result to my enemy. I’m imagining you can replace that with your elevator so that instead of spawning an anergy ball in my case, you’ll be moving the elevator (just triggering an event.).

Sorry, I probably should have explained the project a bit better, but I didn’t know creating an elevator like this would mean so much work… Anyways, the level I am creating is supposed to have several elevators, all independent of each other of course. My solution was to create an actor blueprint that moves the platform up and down (to a certain point above or below its origin) when it is told to do so, something I could just drag and drop into the level.

The solution I had for giving this signal, was to create a separate object, a simple button, I could place wherever I want in the same level, and somehow connect the result from the button to signal the elevator for a specific action (Start, stop, return).

That way, I could add as many buttons in the level as well, and simply connect them to a desired action the elevator would perform. For example, placing three buttons next to each other, and assigning one for start, one for stop, and one for return. The buttons should not have a determined action from the beginning, only what I assign it to. That way I could also use these buttons for different things other than the elevator, it only triggers an event, which means I could use it for something like a lamp or door as well.

Simply put, an actor that works as an actuator, only gives an output signal when pressed, and an action (in this case an elevator), that reacts to this output.

I hope this clearified a few things, I don’t know how to describe it better.

Now, if I use raycast from the character to a button, which gets a hit result from the desired object, can I make an elevator activate in a specific way corresponding to what the button is connected to?

I just want you to know that you have already helped me a lot here, never realized that this was such a difficult topic. Thanks!

In this case button should really on consist of an ‘interact’ button that is triggered when your cursor is on the button.

**On a side note–on the LineTraceByChannel you can see the line traced visually by changing setting on the Draw Debug Type setting on the node, helps for configuration.

So here I cast it to my ButtonTest and then I used a Gate node so that whenever your cursor is over your button, it allows you to use your interaction key (in my this case its just the number 1). If the cast failed (cursor is not on ButtonTest) the Gate closes which means you wont be able to use the interaction key. This interaction key will call the function InteractObject. The function InteractObject is a custom function that you will have to place in each object you want to be able to have interaction. I just wanted to show the flow here but you can ignore the sequence>doonce>printstring nodes here; you can connect the exec in straight from the button test to the open gate node.

Here I’m trying to show that I have a single ButtonTest bp and a single ExplodingBox bp in which I placed two instances of each in the level. Using a branch nodes you can link each instance of your button to any instance of an object in the level.

So this is the general setup in the blueprints of the objects you want interaction with. the custom function that we used in the level blueprint ‘InteractObject’ is defined here, and all it does is allow player input. Then you setup whatever object it is you want to use.

In your elevator example, what I would do is right next to the InteractObject node I might put a PrintString node that says, what floor do you want to go to etc and then enable input so the player can choose a floor or something. Then store the input as a variable in which the ElevatorBP can utilize.

Also, if you want, instead of creating an InteractObject node you can make three custom events for Up Down and Stop and just call those events in the level blueprint. It’s not really a difficult topic it’s just very specific to what you are looking for. Hope this helps!

So the Line Trace node is in the level blue print, or only the hit result? Also, the TestButton objects you use, is it just a static objects, or is it its own blueprint? I think I have to tinker a while with this to get it to work and fully understand it.

Anyway, this has been way more help than what I expected to get, thank you!

I put it in level blueprint but you can in you character bp too. The button is an actor bp but now that I think of it you might be able to use just a static mesh cause there’s on script in the buttonTest I was using.

I put it in level blueprint but you can in you character bp too. The button is an actor bp but now that I think of it you might be able to use just a static mesh cause there’s on script in the buttonTest I was using. I’ll try to think better ways to do it, unreal has got so many tools to utilize

Okay, I’ll test this. I think the only problem I have now is how the button is going to work. You see, I would hope that I could create a bool value that tells if the button is activated or not. This value has to be in the specific button. I’m trying to let the player use line trace, and if the line hits the button object, and the player presses a key, then this value changes to true for as long as the button is held. Do you think this is possible, even with several different buttons in the level?

You can do this by adding a custom function in the your ButtonBP.

I would also use a bool value like you said. Here I just used a FlipFlop node to switch between the two. Then in the LevelBP2 image above, you can call this function (that is specific to each button instance you have in level).

Very nice! Thank you!