Unlock the Secret Door with a Key Item
Unlock the Secret Door with a Key Item
Have you ever wanted to build a secret room in Fortnite? Maybe a treasure chest room or a boss arena? You can make a door that only opens if a player has the right key! We will use a special device called a Conditional Button. It checks what is in your inventory. If you have the key item, the door opens. If not, nothing happens. This makes your island feel like a real puzzle game. Let’s build it!
What You'll Learn
- How to place a Conditional Button device.
- How to tell the button which item is the "key."
- How to connect the button to a door or other device.
- How to test if your secret door works.
How It Works
Imagine you have a locked diary. You can only read it if you have the special diary key. The Conditional Button works just like that lock. It is a button that stays quiet until you hold the right item.
In Fortnite Creative, we use devices to make things happen. A regular button does something when you press it. A Conditional Button is smarter. It looks at your backpack. It asks, "Do you have the Golden Key?" If the answer is yes, it presses the button for you. If the answer is no, it ignores you.
To set this up, you need two things. First, you need the Conditional Button itself. Second, you need an item to use as the key. This could be a melee weapon, a shield potion, or a special prop. You drop the item on the button to teach it what the key is. Then, you connect the button to something else, like a door or a trap.
Let's Build It
We will build a simple secret room. The player needs a specific key item to open the door. Here is how to set it up in UEFN.
Step 1: Place the Devices
First, go to the Creative device library. Search for "Conditional Button." Place it near your door. Next, place an "Item Granter" nearby. This will give the player the key item when they start.
Step 2: Choose Your Key
Decide which item is the secret key. Let’s use a "Shield Potion" for now. It is easy to find in the library.
Step 3: Register the Key
This is the most important step. You must teach the button what the key is.
- Select the Conditional Button.
- Look for the "Register Item" setting in the properties panel.
- Click on it and select "Shield Potion" from the list. Now, the button knows to look for that potion.
Step 4: Connect the Button to the Door
Now we make the door open.
- Select your Conditional Button.
- Find the "Output" setting.
- Choose "Open" if you want the door to open.
- Click on the door device in your island to link them.
Step 5: Give the Player the Key
The player needs to get the key item to test this.
- Select the Item Granter device.
- Set the "Item" to "Shield Potion."
- Set the "On Game Start" option to "Grant Item." Now, when the game starts, every player gets a potion.
The Verse Code (Conceptual)
In Verse, we write code to control devices. But for this simple setup, we mostly use the visual editor. However, here is what the logic looks like in plain Verse code. This helps you understand what is happening behind the scenes.
# This is a simple Verse script for a Conditional Button
# It checks if the player has the key item.
# Define the key item we are looking for
Key_Item := Item_Shop_Shield_Potion
# This function runs when someone interacts with the button
On_Button_Press(Interaction) -> void:
# Check if the player has the key item
If (Interaction.Player.Has_Item(Key_Item)):
# If they have it, open the door
Door.Open()
Else:
# If they don't have it, do nothing
# The player feels stuck, which is good for puzzles!
Print("You need the key to open this door!")
Note: In UEFN, you usually drag and drop connections instead of writing this code. But understanding the logic helps!
Try It Yourself
Now it is your turn to be creative! Try changing the key item. Instead of a Shield Potion, use a "Melee Weapon" like a pickaxe. Or use a "Grenade."
Challenge: Make a door that only opens if the player has two specific items. You might need to look up how to set the "Quantity" setting on the Conditional Button.
Hint: Look for a setting called "Quantity" or "Amount" in the Conditional Button properties. Try setting it to 2. Give the player two items from the Item Granter. See if the door opens when they have both!
Recap
You built a secret door that only opens with a key! You learned that a Conditional Button checks your inventory. You registered an item as the key. Then you connected the button to a door. This is a great way to add puzzles to your island. Keep experimenting with different items and devices. You are becoming a true Fortnite island creator!
References
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-conditional-button-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/using-conditional-button-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/conditional-button-device-design-examples-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/conditional-button-device-design-examples-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-devices-in-fortnite-creative
Verse source files
- 01-fragment.verse · fragment
Turn this into a guided course
Add using-conditional-button-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.