Level Up: Giving Players Gear with Item Granters
Unverified — this example may not compile as-is.
The Verse code below did not pass our automated compile check, so it isn't marked verified and is hidden from the guide listing. The explanation may still be useful, but treat the code as a draft and adapt it before use.
Level Up: Giving Players Gear with Item Granters
Imagine you are building a secret base. You want your friends to find a cool sword when they step on a rug. You don't want them to walk around picking up items. You want the game to hand it to them!
In this tutorial, we will build a "Gear Station." When a player touches a button, they instantly get a weapon. It feels like magic, but it is just smart device setup. Let's make your island awesome.
What You'll Learn
- What an Item Granter device is.
- How to register items for the device to give.
- How to use a Trigger to start the magic.
- How to keep the player's old items safe.
How It Works
Think of the Item Granter as a magical vending machine. It sits in a hidden room. It holds your favorite weapons. It waits for a signal.
The signal comes from a Trigger. A trigger is like a pressure plate. When a player steps on it, it sends a "hello" signal.
We connect the Trigger to the Item Granter. The Trigger says, "Hey Granter!" The Granter listens. It says, "Okay! Here is a sword." The player gets the sword.
We also tell the Granter to Keep All. This means the player keeps their old items. They don't lose their backpack. They just get new stuff. This is super helpful for players.
Let's Build It
We will build a simple room. There is a button on the floor. When you step on it, you get a shotgun.
Step 1: Place the Devices
- Open the Devices tab.
- Search for Item Granter. Place it in the world.
- Search for Trigger. Place it on the floor where you want players to stand.
Step 2: Configure the Item Granter
This is the most important part. We need to fill the vending machine.
- Click on the Item Granter.
- In the options panel, find Item List.
- Click Add Element.
- Select Auto Shotgun (or any weapon you like).
- Find On Grant Action. Set it to Keep All.
- Why? This keeps the player's inventory safe.
- Find Grant Item When Receiving From.
- Set the Device to your Trigger.
- Set the Event to On Triggered.
Step 3: Test It!
Play your island. Walk onto the Trigger. Watch your inventory. Boom! You have a shotgun.
Here is the Verse code behind the scenes. We use Verse to make this work automatically.
# This code makes the Item Granter work
# It listens for the Trigger signal
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# Define our main device
# This is the "brain" of our Gear Station
GearStation := class(creative_device):
# We connect the Trigger to the Granter
# When the Trigger fires, the Granter acts
@editable
Trigger : trigger_device = trigger_device{}
@editable
Granter : item_granter_device = item_granter_device{}
# This function runs when the game starts
OnBegin<override>()<suspends> : void =
# We tell the Trigger to listen
# It watches for players stepping on it
Trigger.TriggeredEvent.Subscribe(OnTriggered)
# This function runs each time the Trigger fires
OnTriggered(Agent : agent) : void =
# The Trigger fired!
# Now we tell the Granter to give items to the agent
Granter.GrantItem(Agent)
Walkthrough:
GearStation := class(creative_device): This is our custom device. It holds the Trigger and the Granter.Trigger : trigger_device: This is the button on the floor.Granter : item_granter_device: This is the hidden box with the weapons.OnBegin: This runs once when the game starts. It sets up the connection.Trigger.TriggeredEvent.Subscribe(OnTriggered): This is the magic link. It says, "When the trigger happens, do this."Granter.GrantItem(Agent): This is the action. It gives the player the items we registered earlier.
Try It Yourself
Can you make a healing station?
Challenge:
- Add a second Item Granter.
- Register a Bandage or Medkit to it.
- Place a new Trigger nearby.
- Connect the new Trigger to the new Granter.
- Test it! Can you heal yourself by stepping on the new button?
Hint: You can have multiple Item Granters in one island. Just make sure each one has its own Trigger. You can also change the On Grant Action to Replace All if you want a fresh loadout.
Recap
You built a Gear Station! You used an Item Granter to hold items. You used a Trigger to send a signal. You connected them together. Now players get gear instantly. This is how pros build fun games. Keep experimenting!
References
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/mazey-escape-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/mazey-escape-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/create-a-hoverboard-race-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/uefn/verse-stronghold-template-4-add-devices-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/create-a-dungeon-crawler-game-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add Using the item granter device to give players gear 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.