To set up a multi-floor elevator system in Unreal Editor for Fortnite (UEFN) with Verse, follow these instructions:
Overview:
You will configure a creative prop to act as the elevator platform. Each floor has a button that calls the elevator. The elevator moves to the floor corresponding to the pressed button, with all floor heights customizable.
Step-by-Step Guide
1. Create the Verse File
- In UEFN:
- Go to Verse → Verse Explorer.
- Right-click your folder, select Create New Verse File.
- Name it elevator_controller.verse.
- Click Create Empty, paste the code below, and save.
verse
using { /Fortnite.com/Devices }using { /Verse.org/Simulation }using { /UnrealEngine.com/Temporary/SpatialMath } # Elevator controller for multiple floorselevator_controller := class(creative_device): @editable ElevatorProp : creative_prop = creative_prop{} @editable CallButtons : []button_device = array{} @editable FloorHeights : []float = array{} @editable MoveTime : float = 2.0 var CurrentFloor : int = 0 var IsMoving : logic = false OnBegin<override>()<suspends> : void = # Subscribe to each call button for (FloorIndex -> Button : CallButtons): Button.InteractedWithEvent.Subscribe(HandleButtonPress) # Handle button press for specific floor HandleButtonPress(Agent : agent) : void = if (IsMoving = false): if (ButtonIndex := GetButtonIndex[Agent]): MoveToFloor(ButtonIndex) # Get the index of the button that was pressed GetButtonIndex(Agent : agent)<transacts><decides> : int = for (Index -> Button : CallButtons): Index 0 # Default to ground floor if not found # Move elevator to specified floor MoveToFloor(FloorIndex : int) : void = if (FloorIndex >= 0 and FloorIndex < FloorHeights.Length): if (Height := FloorHeights[FloorIndex]): set IsMoving = true spawn{MoveElevator(Height, FloorIndex)} # Handle elevator movement MoveElevator(TargetHeight : float, TargetFloor : int)<suspends> : void = CurrentTransform := ElevatorProp.GetTransform() NewPosition := vector3{ X := CurrentTransform.Translation.X, Y := CurrentTransform.Translation.Y, Z := TargetHeight } NewTransform := transform{ Translation := NewPosition, Rotation := CurrentTransform.Rotation, Scale := CurrentTransform.Scale } MoveResult := ElevatorProp.MoveTo(NewTransform, MoveTime) if (MoveResult = move_to_result.DestinationReached): set CurrentFloor = TargetFloor set IsMoving = false # Get current floor GetCurrentFloor() : int = CurrentFloor # Check if elevator is moving IsElevatorMoving() : logic = IsMoving
2. Build the Verse Code
- In UEFN, click Verse → Build Verse Code (or press Ctrl + Shift + B) until Build Succeeded appears.
- The new device appears in the Content Browser.
3. Place Devices in Your Level
- Drag elevator_controller into the world.
- Add Devices Needed:
- A Creative Prop to act as your elevator platform (e.g., a platform mesh).
- One Button Device for each floor of your elevator (e.g., place 3 buttons for 3 floors).
4. Assign @editable References and Configure Devices
- Select your elevator_controller device.
- In the Details panel:
- Set ElevatorProp → the platform prop you want to move.
- Set CallButtons → assign every floor call button (each button represents a floor, first = ground floor, etc.).
- Set FloorHeights → add a float value for each floor’s Z coordinate (height for each stop, in cm relative to world origin; e.g., Ground Floor = 0.0, Floor 2 = 400.0, …).
- Adjust MoveTime to change elevator movement speed as desired.
- Place each Button at its corresponding floor.
5. Launch and Test
- Click Launch Session or Push Changes.
- Press buttons in-game to move the elevator platform to the selected floor.
How the Code Works
- On game start, each button subscribes to a handler.
- When a button is pressed, if the elevator isn’t already moving, it moves the elevator prop to the chosen floor’s height.
- Movement is handled smoothly, and the elevator can’t be called again until it finishes the current trip.
Tips:
- You can expand FloorHeights for as many floors as you need.
- Make sure the platform prop snap aligns with your desired floor heights.
- You can further add doors, call sounds, or lights using other Verse logic or creative devices.
You might find these useful
multi floor
To set up a multi-floor elevator in Unreal Editor for Fortnite (UEFN) using Verse, follow these steps. This elevator will move a platform to any selected floor using a Prop Mover and floor call buttons.
Step-by-Step: Multi-Floor Elevator Device
1. Place Devices in the Level
- Prop Mover Device:
Drag a Prop Mover device into your level. This acts as the elevator platform.
- Button Devices:
Place a Button device at each floor you want. Each button will call the elevator to that floor.
- Note Floor Positions:
Record the vector3 location for each floor (you can find these in UEFN by selecting a point and copying the location).
2. Add the Verse Device
- Open Verse Explorer (Menu → Verse → Verse Explorer).
- Right-click your folder and Create New Verse File.
Name it multi_floor_elevator and choose Create Empty.
- Paste the code below and save.
verse
using { /Fortnite.com/Devices }using { /Verse.org/Simulation }using { /UnrealEngine.com/Temporary/SpatialMath }using { /Verse.org/Native } # Represents a single floor in the elevator systemelevator_floor := struct<concrete>: FloorNumber : int = 0 Position : vector3 = vector3{} CallButton : button_device = button_device{} # Main elevator controller devicemulti_floor_elevator := class(creative_device): @editable ElevatorPlatform : prop_mover_device = prop_mover_device{} @editable Floors : []elevator_floor = array{} @editable MoveTime : float = 3.0 var CurrentFloor : int = 0 var IsMoving : logic = false OnBegin<override>()<suspends> : void = # Subscribe to all floor call buttons for (FloorIndex -> FloorData : Floors): FloorData.CallButton.InteractedWithEvent.Subscribe(OnFloorButtonPressed) # Handle floor button presses OnFloorButtonPressed(Agent : agent) : void = if (IsMoving = false): for (FloorIndex -> FloorData : Floors): MoveToFloor(FloorData.FloorNumber) # Move elevator to specified floor MoveToFloor(TargetFloor : int) : void = if (TargetFloor >= 0 and TargetFloor < Floors.Length): if (IsMoving = false): set IsMoving = true spawn{MoveElevator(TargetFloor)} # Async function to handle elevator movement MoveElevator(TargetFloor : int)<suspends> : void = if (TargetFloor >= 0 and TargetFloor < Floors.Length): if (TargetFloor <> CurrentFloor): if (TargetFloorFloor := Floors[TargetFloor]): # Move platform to target floor position ElevatorPlatform.MoveTo(TargetFloorFloor.Position, rotation{}, MoveTime) Sleep(MoveTime) set CurrentFloor = TargetFloor set IsMoving = false # Call elevator to current floor CallElevator() : void = MoveToFloor(CurrentFloor)
- In UEFN, go to Verse → Build Verse Code (Ctrl + Shift + B).
3. Add & Configure the Verse Device
- Drag your new multi_floor_elevator device into the world.
- In the Details panel:
- Assign the ElevatorPlatform to your Prop Mover device.
- For each floor, add an entry to the Floors array:
- Set FloorNumber (0 for ground, 1 for first, etc).
- Set Position to that floor’s platform location (vector3).
- Assign the CallButton to the Button at that floor.
- Adjust MoveTime if needed.
4. How It Works
- When a player presses a floor’s button, the platform moves to that floor’s position.
- The elevator will not respond to other calls while in motion.
5. Test Your Elevator
- Click Launch Session or Push Changes to test your setup.
Tips:
- You can add as many floors as needed by expanding the Floors array.
- Make sure each button is properly assigned to the right floor.
- Adjust MoveTime for faster/slower travel.