The Cuddle Fish Chaos: Building Your First Attack Item Island
Tutorial beginner compiles

The Cuddle Fish Chaos: Building Your First Attack Item Island

Updated beginner Code verified

The Cuddle Fish Chaos: Building Your First Attack Item Island

Forget boring shootouts. Real Fortnite pros know the sweetest way to end a match isn't with a sniper rifle, but with a well-thrown Cuddle Fish or a surprise Junk Rift. In this tutorial, we're skipping the complex coding of damage math and focusing on the fun part: Item Granters.

We're building a "Loot Goblin" station. You'll place a device that hands out attack items (like Storm Flips or Dynamite) to players who step on a button. It's the digital equivalent of a vending machine that dispenses chaos instead of soda. By the end, you'll have a playable loop where players grab gear, throw it, and cause mayhem.

What You'll Learn

  • Item Granters: How to use UEFN devices to give players specific items without coding from scratch.
  • Triggers: How to make a physical object (like a button) react when a player touches it.
  • The Scene Graph: Understanding how devices talk to each other in the game world.
  • Verse Basics: A tiny bit of code to make your button actually work (yes, you'll write some code, but it's shorter than a tweet).

How It Works

Imagine you're in a lobby. You walk up to a vending machine, press a button, and a bag of chips falls out. That's exactly what we're building, but the "chips" are deadly Cuddle Fish.

In UEFN, we use Devices. Think of devices as the electrical appliances in your island. A Prop Mover is a fan that pushes you. An Item Granter is a dispenser that gives you stuff. A Trigger is a pressure plate.

Here is the game mechanic analogy:

  • The Trigger is the floor tile you step on. It's like the "Start" button on a game console.
  • The Item Granter is the box that holds the loot. It's like your inventory slot, but it can give items to other people.
  • Verse is the wiring. It connects the "Start" button to the "Dispense" command.

We aren't coding the physics of a Cuddle Fish exploding. Epic did that for us. We are just coding the logic: "When Player Steps Here -> Give Player Cuddle Fish."

Let's Build It

We are going to build a simple Cuddle Fish Dispenser.

Step 1: Place Your Devices

  1. Open UEFN and enter Create Mode.
  2. Press Tab to open the Creative Inventory.
  3. Search for and place these three devices on the ground:
    • Trigger (Category: Gameplay)
    • Item Granter (Category: Items)
    • Button (Category: Gameplay)
  4. Arrange them like this:
    • Place the Button on a raised platform or wall.
    • Place the Trigger on the floor right in front of the button.
    • Place the Item Granter nearby (it doesn't matter exactly where, but keep it visible).

Step 2: Configure the Item Granter

  1. Click on the Item Granter.
  2. In the properties panel on the right, find Item Type.
  3. Change it from "None" to Cuddle Fish.
  4. Set Quantity to 1.
  5. Pro Tip: If you want to be extra chaotic, change the Item Type to Junk Rift. Now you're handing out potential disaster.

Step 3: Connect the Dots with Verse

This is where the magic happens. We need to tell the Trigger: "Hey, when someone stands on you, press this Button." And we need to tell the Button: "Hey, when you're pressed, activate this Item Granter."

  1. Click on the Trigger.

  2. In the properties panel, find the On Begin Play or On Start section. We want to trigger when a player steps on it. Look for On Player Begin Overlap.

  3. You'll see a slot for Actions. Click the + to add an action.

  4. Select Call Function or Trigger. Wait, let's keep it simple.

    Actually, let's use Verse for a cleaner, more "programmer" approach that teaches you how devices talk.

    Let's reset the logic slightly for a pure Verse tutorial experience.

    1. Delete the Button. We don't need it if we code the Trigger directly to the Granter.
    2. Click on the Trigger.
    3. In the properties panel, find the Verse Script section. If you don't see it, make sure you have the Verse plugin enabled.
    4. Click Edit Script. This opens a text editor.

The Code: CuddleDispenser.verse

Copy this code into the editor. Don't worry, I'll explain it below.

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

# CuddleDispenser: a creative_device that wires a trigger_device
# to an item_granter_device so stepping on the trigger hands out loot.
cuddle_dispenser := class(creative_device):

    # This is a "Variable".
    # Think of a variable as a loot box.
    # It starts empty, but we will fill it with the Item Granter.
    # Tag this with @editable so UEFN shows it in the Details panel —
    # that is where you drag-and-drop your Item Granter device to link it.
    @editable
    Granter : item_granter_device = item_granter_device{}

    # This is a "Variable" for the Trigger device.
    # Same idea: tag it @editable and assign it in the Details panel.
    @editable
    MyTrigger : trigger_device = trigger_device{}

    # OnBegin is called automatically when the island starts.
    # Think of it as the "Match Start" whistle — it runs once,
    # and we use it to subscribe to the trigger's overlap event.
    OnBegin<override>()<suspends> : void =
        # Subscribe means: "Watch for this event and call my handler."
        # TriggeredEvent fires whenever a player steps on the trigger.
        MyTrigger.TriggeredEvent.Subscribe(OnPlayerTriggered)

    # This is a "Function".
    # Think of a function as a specific move in Fortnite, like "Vault" or "Peek".
    # It's a block of instructions that happens when called.
    # TriggeredEvent passes the agent (the player) who activated the trigger.
    OnPlayerTriggered(TriggeredAgent : ?agent) : void =
        # Cast agent to fort_character so we can confirm it is a real player.
        # If the cast fails (e.g. an NPC), the if-block is skipped safely.
        if (ActualAgent := TriggeredAgent?, Player := ActualAgent.GetFortCharacter[]):
            # GrantItem tells the Item Granter to give its configured item
            # to this specific player — like pressing "Equip" in your inventory.
            Granter.GrantItem(ActualAgent)```

### Walkthrough: What Just Happened?

1.  **`cuddle_dispenser := class(creative_device):`**: We created a new class that inherits from `creative_device`. In the Scene Graph, this is like creating a new folder. It's a container for our logic.
2.  **`@editable` / `Granter : item_granter_device`**: This is a **Variable**. 
    *   *Game Analogy:* Imagine your backpack has a slot labeled "Special Item." Right now, it's empty (`item_granter_device{}`). We need to put the Item Granter device into that slot.
    *   *In UEFN:* When you save this script, UEFN will ask you to assign the `Granter` variable. Click on the **Item Granter** device in your world, and it will link them together. Now the Trigger knows *which* granter to use.
3.  **`MyTrigger.TriggeredEvent.Subscribe(OnPlayerTriggered)`**: This is an **Event**. 
    *   *Game Analogy:* This is like the "Storm Timer" reaching zero. It's a moment in time that the game watches for. The game says, "Did a player start overlapping with this trigger?" If yes, run the code inside.
4.  **`Granter.GrantItem(TriggeredAgent)`**: This is a **Function Call**. 
    *   *Game Analogy:* This is the "Elimination" event. It's the action that actually changes the game state. We are telling the granter: "Hey, give an item to this specific player."

### Step 4: Test It
1.  Save the script.
2.  Click **Apply** or **Compile**. If you made a typo, Verse will yell at you (in red text). Fix it!
3.  Play your island.
4.  Walk onto the **Trigger**.
5.  Press `E` (or your item use key). You should now have a Cuddle Fish!

## Try It Yourself

You've got the basics. Now, let's add some chaos.

**Challenge:** Modify your script to give a **Storm Flip** instead of a Cuddle Fish.

*Hint:* You don't need to change the Verse code much. You just need to change the **Item Granter** device in the editor. 
1. Click the Item Granter in your world.
2. Change the **Item Type** property to **Storm Flip**.
3. Playtest.

*Bonus Challenge:* Can you make the Trigger give *two* items? 
*Hint:* Look at the Item Granter properties. Is there a "Quantity" setting? Change it to 2. Does your Verse code need to change? (Think about whether the code knows *how many* to give, or if it just says "Give Item.")

## Recap

*   **Devices** are the building blocks of your island.
*   **Item Granters** hand out loot.
*   **Triggers** detect when players interact with the world.
*   **Verse** connects them: The Trigger detects the player, and tells the Granter to give the item.
*   **Variables** are like labeled inventory slots that hold references to other devices.

You've just built your first interactive system. No more static loot boxes. You're now a device-wizard. Go make some Cuddle Fish chaos.

## References

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

Verse source files

Turn this into a guided course

Add using-attack-items-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