The Art of the Spy: Building a Social Deduction Island with Verse
Tutorial beginner

The Art of the Spy: Building a Social Deduction Island with Verse

Updated beginner

The Art of the Spy: Building a Social Deduction Island with Verse

So, you want to build a Among Us or Squid Game style island? You don’t need to be a math wizard to pull off a convincing spy mission. In Fortnite Creative, "disguise" isn't just about hiding in a bush (though that’s classic); it’s about data manipulation. You’re essentially telling the game engine, "Hey, Player A looks like Player B right now."

In this tutorial, we’re going to build a "Spy Switcher" Station. Players will walk up to a terminal, and with the press of a button, they’ll swap their outfit to look like a specific NPC (or another player, if you’re feeling fancy). We’ll use Verse to handle the logic, turning a simple prop into a high-tech infiltration device.

What You'll Learn

  • Variables: How to store a "target look" so your code remembers which disguise to apply.
  • Events: Triggering code when a player interacts with a device.
  • APIs: Using the built-in "Disguise" commands to change player appearances.
  • Scene Graph Basics: Understanding how your Verse script connects to the physical device in the editor.

How It Works

Think of a Variable like a loot drop. When you pick up a shield potion, your "Shield Level" variable changes from 0 to 50. It holds a value that can change. In our case, we want a variable to hold the "Outfit ID" of the disguise we want to apply.

Think of an Event like a storm timer or a trigger pad. Something happens in the world (a player walks on a pad, presses a button), and the game reacts. We’re going to listen for the "Interact" event on our Spy Station.

The Scene Graph is just the family tree of your island. Your Verse script is a child of the Spy Station device. The script can "reach up" to the device to ask, "Hey, did someone press me?" and "reach down" to the player to say, "Put on this skin."

Let's Build It

We are building a Spy Switcher. When a player interacts with it, they turn into the "Hooded Figure" (or whatever outfit you choose). If they get hit, the disguise breaks. Simple. Effective. Spooky.

Step 1: The Setup (UEFN Editor)

  1. Open UEFN and create a new Island.
  2. Go to the Content Drawer -> Devices -> Logic.
  3. Find the Disguise device. Drag it into your world.
  4. In the Details Panel for the Disguise device:
    • Disguise: Select the outfit you want players to become (e.g., "Hooded Figure" or any NPC outfit).
    • Disguise Breaks on Attack: Check this box. (If they punch someone, they look like themselves again).
    • Disguise Breaks on Damage: Check this box. (If they get shot, the disguise pops).
  5. Now, we need a Verse Script to control this. Right-click the Disguise device in the hierarchy (left side of the screen) and select Create New Verse Script. Name it SpyStationScript.

Step 2: The Verse Code

Here is the code. It’s short, sweet, and does exactly what it says on the tin.

# SpyStationScript.ver
# A simple script that applies a disguise when a player interacts with the device.

using { /Fortnite.com/Devices }
using { /Verse.org/Sim }

# This is our main Script class. It attaches to the Disguise device.
# Think of this as the "Brain" of the Spy Station.
spy_station := class(VerseSpeaker):

    # This is a VARIABLE.
    # It's like a persistent memory slot in your backpack.
    # We'll use it to store the "last known player" if we wanted to,
    # but for now, we just use it to keep the script tidy.
    last_interaction_time := 0.0

    # This is an EVENT.
    # It's like a tripwire. When the device is interacted with,
    # this function automatically runs.
    on_interact(event: DeviceInteractedEvent) -> unit:
        # 'event' contains info about who triggered it.
        # We need to find out who the player is.
        player := event.GetInstigator()

        # Check if the instigator is actually a player.
        # (Prevents bots or projectiles from triggering the disguise).
        if (player != None && player.IsPlayer()):
            # Here is the MAGIC API call.
            # We are telling the game engine:
            # "Apply the Disguise defined in this device to this player."
            # The Disguise device handles the heavy lifting of
            # swapping the mesh and animations.
            player.ApplyDisguise()

            # Optional: Print a message to the player's chat
            # so they know it worked.
            player.SendTextMessage("Disguise Applied! Look cool.")

Walkthrough

  1. spy_station := class(VerseSpeaker):: This defines our script. VerseSpeaker is the base class that lets our code talk to devices.
  2. on_interact(event: DeviceInteractedEvent) -> unit:: This is the Event. The game engine calls this function whenever someone presses "Interact" (usually 'E' or the face button) on the Disguise device.
  3. player := event.GetInstigator(): This is a Function (a reusable block of code). It grabs the "Instigator" (the doer) of the event. If you press the button, you are the instigator.
  4. player.ApplyDisguise(): This is the API Call. It’s a command built into Fortnite’s engine. It says, "Hey, Player, put on the outfit configured in your parent device."

Step 3: Testing It

  1. Click the Play button in UEFN.
  2. Walk up to your Disguise device.
  3. Press Interact.
  4. Watch your character transform into the selected outfit.
  5. Try to punch a wall. The disguise should break, and you should return to your normal skin.

Try It Yourself

Challenge: Currently, the disguise breaks if you attack or take damage. What if you want the disguise to be permanent until you walk away from the device?

Hint: Look at the Details Panel of the Disguise device again. There are checkboxes for "Disguise Breaks on Attack" and "Disguise Breaks on Damage." Try unchecking them. Does the Verse code need to change? (Spoiler: No! That’s the beauty of separating logic from configuration).

Bonus Challenge: Can you make it so the disguise only works if the player has a specific item in their inventory (like a "Spy Token")? You’ll need to learn about Inventory Queries in Verse. Start by looking up GetInventoryItem in the Verse documentation.

Recap

  • Variables store data (like your current shield or a timer).
  • Events react to gameplay moments (like interacting with a device).
  • APIs are the tools Fortnite gives you to change the world (like ApplyDisguise).
  • The Scene Graph connects your script to the physical device in the editor.

Now go forth and confuse your friends. Or just look like a snowman in the middle of a summer map. The power is yours.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/using-disguise-items-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-disguise-consumables-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-disguise-devices-in-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/squid-game-deception-through-disguises-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/36-10-fortnite-ecosystem-updates-and-release-notes

Verse source files

Turn this into a guided course

Add using-disguise-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