Elevator Button Blueprints

Ello,

So, I’m attempting to create an elevator that operates through blueprints. At the moment, I have it so that if a player walks up to the panel and presses the F key the doors will open. After a 3 second delay the doors will close(once the player leaves the trigger box). On the inner console of buttons in the elevator the player can then also press the F key, though this time it will bring up a new UI. This UI consists of three buttons, one button for the lobby(where the player starts), one for the 5th floor, and one for the roof. If the player presses F they can close that menu down completely and leave the elevator, however, I’d like to program it so that the blueprint checks which level the player is currently in and disables the button that corresponds to that level. Essentially, if I’m on the 5th floor, I’d like it so that the Lobby and Roof buttons are still lit but the 5th floor button is no longer clickable.

I think that this could be achieved upon constructing the event and checking the current level name but beyond that I’m completely stuck. If anyone has any ideas on how to code this I’d be most appreciative.

It’s hard to perceive the concept that your scene with only your text, but I’ll try my best to answer as how would I solve.

First, in this case, I would not use “branch”, as long as you want to make many decision with one case variable.
You have at least 3 possible case for floor. 5th, Lobby, and Roof.
I would make use switch on string or switch on int. and you can refer down.
https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/FlowControl/index.html#switchnodes
and I’d suggest to use the “switch on int” for performance purpose, but you need to make an integer variable when level is loading as start event, not the event tick. Likewise 5th is 0 Lobby is 1 Roof is 2, then swich on int with those number and make a control by those integer number.

I hope my answer would bit helpful, Thank you!

I apologize if I wasn’t clear enough. I’ll try to use images to better illustrate my intent.

Essentially, I have an elevator:

When the player approaches the elevator and passes over the trigger box they can use the F button to interact with the console. This opens the elevator doors, leading to the inner elevator:

Once the player passes over the trigger box in the inner elevator they can press the F button to interact with the console.

The idea is that the player will see a greyed out button for whatever map they are currently on. Any button that is lit up and not greyed out can be clicked on to load the corresponding map. So, if the player is on the 5th floor, the button would be greyed out much like you see in the above image. However, if the player was on the roof, the 5th floor would be lit up again and the roof would now be inactive.

At any time the player can press the F button again and it will close the button ui and open the doors again, in case they want to leave the elevator and go back to the floor they came from.

The button to load a new level is easy, and this is the blueprint I’m using for that:

The blueprints for the trigger boxes that open the door and interact with the console are in the level blueprint and are constructed thusly:

Hopefully that clears up any confusion from my end to yours and I will start looking into your advice as how to fix it.