Build a Trap Zone with Ranged Weapon Consumables
Tutorial beginner compiles

Build a Trap Zone with Ranged Weapon Consumables

Updated beginner Code verified

Build a Trap Zone with Ranged Weapon Consumables

Imagine a secret room in your Fortnite island. When a player walks in, they don't get a gun. They get a Rusty Can! It's a fun surprise. You can also use Shadow Bombs to confuse enemies. Or Boogie Bombs to make them dance.

In this tutorial, you will learn how to give players these special items. You will make a "trap zone." When players enter it, they get a weapon consumable. This makes your island more exciting. It adds chaos and fun. Let's build it!

What You'll Learn

  • What Ranged Weapon Consumables are.
  • How to use a Trigger Volume to detect players.
  • How to use the Grant Item device to give items.
  • How to set up a simple "trap" in UEFN.

How It Works

Think of a Consumable like a snack. You eat it, and it's gone. In Fortnite Creative, some snacks are weapons. These are Ranged Weapon Consumables.

Here are a few popular ones:

  • Rusty Can: Throws a can that hurts players.
  • Shadow Bomb: Throws a bomb that makes players invisible.
  • Boogie Bomb: Throws a bomb that makes players dance.
  • Stink Bomb: Throws a bomb that slows players down.

To give these to players, we use two main tools:

  1. Trigger Volume: This is like an invisible door. When a player steps inside, it wakes up.
  2. Grant Item Device: This is like a magic vending machine. It gives an item to the player who triggered it.

We will connect them. When the Trigger wakes up, it tells the Vending Machine to give a Rusty Can. Simple!

Let's Build It

We will build a small room. It will have a trigger on the floor. When you step on it, you get a Rusty Can.

Step 1: Place the Devices

Open UEFN. Go to the Devices tab. Search for these two devices:

  1. Trigger Volume
  2. Grant Item

Place them near each other on your island.

Step 2: Configure the Trigger

Click on the Trigger Volume. In the details panel (on the right), look for Events.

  • Find On Begin Overlap. This event fires when a player walks in.

Step 3: Configure the Grant Item

Click on the Grant Item device.

  • Find Item Type. Click the dropdown.
  • Search for Rusty Can. Select it.
  • Find Quantity. Set it to 1.

Step 4: Connect Them

This is the magic part. We need to link the Trigger to the Grant Item.

  1. Click the Trigger Volume device.
  2. Look for the small circle (output) next to On Begin Overlap.
  3. Drag a line from that circle to the Grant Item device.
  4. Release the mouse. A menu will pop up.
  5. Select Grant Item.

Now, when a player overlaps the volume, it calls the Grant Item device.

Step 5: Test It!

Press Play. Walk into the Trigger Volume. You should now have a Rusty Can in your inventory! Throw it at a friend. Watch them take damage.

Here is how this looks in Verse. We will write a simple script to do the same thing, but with more control. This is how pros do it.

# This is our main script file.
# It connects a trigger to a reward.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# We create a new "Actor".
# An Actor is a thing in our game world.
# Think of it like a character or a prop.
rusty_can_trap := class(creative_device):

    # This is our Trigger Volume.
    # It watches for players.
    # Wire this in the UEFN editor Details panel.
    @editable
    Trigger : trigger_device = trigger_device{}

    # This is our Item Granter.
    # It gives the item.
    # Wire this in the UEFN editor Details panel.
    @editable
    Granter : item_granter_device = item_granter_device{}

    # OnBegin runs once when the game starts.
    # We use it to subscribe to the trigger's overlap event.
    OnBegin<override>()<suspends> : void =
        # TriggeredEvent fires whenever any agent steps inside.
        # We pass our handler function to be called each time.
        Trigger.TriggeredEvent.Subscribe(OnTriggered)

    # This function runs when a player steps in.
    # Agent is the game's word for a player or NPC.
    # The parameter is ?agent because TriggeredEvent passes an optional agent.
    OnTriggered(MaybeAgent : ?agent) : void =
        # We tell the granter to give its configured item.
        # The item type is set in the UEFN editor, not in code.
        # note: item_granter_device.GrantItem takes an agent, not a string.
        if (Agent := MaybeAgent?):
            Granter.GrantItem(Agent)```

Let's break down the code:
*   `rusty_can_trap` defines our trap as a `creative_device`.
*   `@editable` lets us wire `Trigger` and `Granter` in the UEFN editor Details panel.
*   `OnBegin` runs at game start and subscribes `OnTriggered` to the trigger's `TriggeredEvent`.
*   `OnTriggered` is called every time a player steps inside. It receives the overlapping `Agent`.
*   `Granter.GrantItem(Agent)` sends the item  configured in the editor  to that specific player.

## Try It Yourself

Now it's your turn to be creative!

**Challenge:**
Change the trap. Instead of a Rusty Can, make it give a **Boogie Bomb**.

**Hint:**
1.  Go back to the **Grant Item** device in UEFN.
2.  Change the **Item Type** to **Boogie Bomb**.
3.  If you are using the Verse code, the item type is set in the editor, not in the script. So you only need to update the device setting  the code stays the same!
4.  Play your island! Try to make a friend dance.

## Recap

You just built a working trap! You learned:
*   **Consumables** are items you use once.
*   **Ranged Weapon Consumables** are weapons you throw.
*   **Trigger Volumes** detect when players enter a space.
*   **Grant Item Devices** give items to players.

You can now make your own secret loot rooms. Keep experimenting! What other bombs can you add?

## References

*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-ranged-weapon-consumables-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/using-ranged-weapon-items-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-consumables-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/fortnite-glossary
*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-explosive-consumables-in-fortnite-creative

Verse source files

Turn this into a guided course

Add using-ranged-weapon-consumables-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.

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.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in