Snap It Together: Build with LEGO Assembly Devices
Snap It Together: Build with LEGO Assembly Devices
Welcome, young creators! Do you love building with LEGOs? Now you can let your players build them too. We will make a toy castle appear when a player presses a button.
This is super cool. It feels like magic. One moment the spot is empty. The next, a castle stands tall. We will use a special tool called the Assembly Device. This tool makes LEGO pieces appear or disappear. You can control it with a simple switch. Let's get building!
What You'll Learn
- How to use the Assembly Device.
- How to make props appear using a Switch.
- How to hide props to clear the path.
- The basics of Verse code for LEGO islands.
How It Works
Imagine you have a box of LEGOs. Some pieces are hidden. You want them to snap into place. The Assembly Device does exactly this. It finds LEGO props in an area. It can make them visible or invisible.
Think of it like a light switch. When the switch is off, the light is dark. When the switch is on, the light is bright. Here, the "light" is the LEGO castle. The "switch" is a button on the ground.
We will use Verse to connect them. Verse is the code language for Fortnite islands. It tells the game what to do. We will write code that says: "If the player presses the switch, make the castle appear."
This works for LEGO bricks only. It does not work with regular stone walls. It is made for LEGO islands. You can also make the pieces fall apart later. That is fun too! But first, let's build.
Let's Build It
We will build a small tower. It will appear when a player steps on a trigger pad.
Step 1: Place Your Props
First, open your LEGO island. Place your LEGO tower where you want it. It can be anywhere. It does not need to be perfect. The device will handle the rest.
Step 2: Add the Assembly Device
Go to the Content Drawer. Look for LEGO® Content. Find the Assembly Device. Drag it into your world. Place it near your tower.
You will see a circle around the device. This is the Interaction Radius. Any LEGO prop inside this circle can be controlled. Make sure your tower is inside the circle.
Step 3: Add a Trigger
We need a way to start the magic. Let's use a Trigger Volume. Find it in the devices list. Place it on the ground. This is the pad the player will step on.
Step 4: Write the Code
Now we add the brain. We will use Verse. Copy this code into a Verse file.
# This is the main script for our LEGO tower
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
# We define the devices we will use
lego_tower_manager := class(creative_device):
# The assembly device controls the tower
@editable
assembly_device : creative_device = creative_device{}
# The trigger detects the player
@editable
trigger : trigger_device = trigger_device{}
# This function runs when the game starts
OnBegin<override>()<suspends> : void =
# Connect the trigger to our code
# When the trigger fires, run 'OnTriggered'
trigger.TriggeredEvent.Subscribe(OnTriggered)
# This function runs when a player steps on the pad
OnTriggered(Agent : ?agent) : void =
# Make the LEGO tower appear
# We set it to visible
assembly_device.Show()
# You can also play a sound here if you want!```
### What Does This Code Do?
* `using { /Fortnite.com/Devices }`: This tells Verse we want to use game devices.
* `assembly_device : lego_assembly_device`: This creates a spot for our Assembly Device. It is like an empty box.
* `trigger : trigger_device`: This creates a spot for our trigger pad.
* `OnBegin`: This runs once when the level starts. It connects the trigger to the code.
* `OnTriggered`: This runs when someone steps on the pad.
* `assembly_device.Assemble()`: This makes the LEGO tower appear by snapping all pieces into place.
### Step 5: Test It!
Save your Verse file. Place the file in your island. Press **Play**. Walk onto the trigger pad. Watch your tower appear! You did it.
## Try It Yourself
Great job! You made a tower appear. Now, try this challenge.
**Challenge:** Make the tower disappear when the player steps on the trigger again.
**Hint:** Look at the code line `assembly_device.Assemble()`. The `lego_assembly_device` also has a function that does the opposite. What word means "take apart" instead of "put together"?
Think about it. If `Assemble()` shows it, what hides it?
## Recap
You learned how to use the **Assembly Device**. You made LEGO props appear with a trigger. You used simple Verse code to control the game. This is just the start. You can make castles, bridges, or vehicles appear. Have fun building your own LEGO world!
## References
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-lego-assembly-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite/using-lego-assembly-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/uefn/33-00-release-notes-in-unreal-editor-for-fortnite
* https://dev.epicgames.com/documentation/en-us/fortnite/building-lego-islands-in-fortnite
* https://dev.epicgames.com/documentation/en-us/fortnite/using-lego-collectible-devices-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-lego-assembly-devices-in-fortnite-creative to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.