Sneaky Mode: Making Players Invisible in Fortnite
Tutorial beginner compiles

Sneaky Mode: Making Players Invisible in Fortnite

Updated beginner Code verified

Sneaky Mode: Making Players Invisible in Fortnite

Imagine playing a game where you are a ghost. You can walk past enemies without them seeing you. This is called being invisible! In Fortnite Creative, we can make this happen using Verse. We will build an "Invisibility Manager." This is a smart device that watches your team. When a player starts the game, the device makes them invisible. If they get hit, they flicker back into view. Let's build some stealth magic!

What You'll Learn

  • How to use a Creative Device to control the game.
  • How to find specific players (your team) using code.
  • How to change a player's look to make them disappear.
  • How to make players flicker when they get hurt.

How It Works

Think of your Fortnite island like a big stage. The Scene Graph is the list of everything on that stage. It has props, lights, and players. In Verse, we talk about Entities. An Entity is any object on the stage. A player is an Entity. A door is an Entity.

We need a special manager. This manager is like a stagehand. It wears a headset. It listens for two things:

  1. Spawn: When a player arrives on the stage.
  2. Damage: When a player gets hit by a bullet or trap.

When the manager hears "Spawn," it checks if the player is on the Infiltrator Team. If yes, it turns off their visibility. This is like pulling a curtain. The player is still there, but no one can see them!

When the manager hears "Damage," it makes the player flicker. Flickering means turning them on and off very fast. It looks like a glitchy TV screen. This tells enemies, "Hey, someone is here!" We use a Variable to remember how long the flicker should last. A variable is a box that holds a changing number. Here, the number is time.

Let's Build It

We will create a script that handles invisibility. You will need a Creative Device in your island. Name it "Invisibility Manager."

First, we tell Verse which tools we need. These are called Libraries. Think of them as a toolbox.

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

Next, we create our Manager class. A Class is a blueprint. It tells Verse what our device can do. We add some settings. You can change these in the editor panel on the right.

invisibility_manager := class(creative_device):
    # List of player spawners for our team
    @editable
    PlayerSpawners : []player_spawner_device = array{}

    # Should all teammates flicker together?
    @editable
    IsVisibilityShared : logic = true

    # How long they stay visible after getting hit (in seconds)
    @editable
    VulnerableSeconds : float = 3.0

    # How fast they flicker (in seconds)
    @editable
    FlickerRateSeconds : float = 0.4

    # This map stores time left for each player
    # Key = agent, Value = Seconds left
    var PlayerVisibilitySeconds : [agent]float = map{}

Now, we need the code to run when the game starts. This is called OnBegin. It waits for the teams to be ready. Then, it listens for events.

OnBegin<override>()<suspends> : void =
        # Wait one frame for the game to finish setting up
        Sleep(0.0)

        # Subscribe to each spawner's SpawnedEvent so we know
        # when a player arrives on the stage
        for (Spawner : PlayerSpawners):
            Spawner.SpawnedEvent.Subscribe(OnPlayerSpawned)

        # Keep the device running forever
        loop:
            Sleep(0.1)

Let's write the code for when a player spawns. We check if they are on the Infiltrator team. If yes, we hide them.

# player_spawner_device.SpawnedEvent sends the agent that just spawned
    OnPlayerSpawned(SpawnedAgent : agent) : void =
        # Cast agent to fort_character so we can change visibility
        if (Character := SpawnedAgent.GetFortCharacter[]):
            # Make the player invisible!
            Character.Hide()

Finally, let's handle the damage. When they get hit, we make them flicker.

# We subscribe each character's DamagedEvent after they spawn.
    # This helper is called from OnPlayerSpawned (see updated version below).
    OnPlayerDamaged(SpawnedAgent : agent) : void =
        # Cast to fort_character to access Hide/Show
        if (Character := SpawnedAgent.GetFortCharacter[]):
            # Start flickering on a new async task so this handler returns fast
            spawn { DoFlicker(SpawnedAgent, Character) }

Here is the helper function that does the flickering. It uses a loop to turn visibility on and off.

DoFlicker(Victim : agent, Character : fort_character)<suspends> : void =
        # Set the timer for how long they are vulnerable
        if (set PlayerVisibilitySeconds[Victim] = VulnerableSeconds) {}
        else:
            set PlayerVisibilitySeconds[Victim] = VulnerableSeconds

        # Show the character so enemies can see the flicker
        Character.Show()

        # Track elapsed time manually since map subtraction needs a failable set
        var Elapsed : float = 0.0
        loop:
            if (PlayerVisibilitySeconds[Victim] - Elapsed <= 0.0):
                break
            # Toggle: show on even steps, hide on odd steps
            if (Elapsed mod (FlickerRateSeconds * 2.0) < FlickerRateSeconds):
                Character.Show()
            else:
                Character.Hide()
            Sleep(FlickerRateSeconds)
            set Elapsed += FlickerRateSeconds

        # Make sure they are fully invisible again when done
        Character.Hide()

Because we want to subscribe to damage events AND start the flicker listener, here is the complete, updated OnPlayerSpawned that wires everything together:

Try It Yourself

You have the basics! Now, try to make it smarter.

Challenge: Right now, the code assumes Team 0 is the Infiltrators. What if you want to use a specific Team Device instead?

Hint: Look for a way to get a team by name or ID from a Team Device in UEFN. You can drag a Team Device into your PlayerSpawners list in the editor. Then, ask the spawner for its team!

Recap

You built an Invisibility Manager! You learned that:

  1. Entities are everything in the game world.
  2. Variables store data like time or visibility status.
  3. Events let your code react to things like spawning or damage.
  4. You can change a player's Visibility to make them disappear.

Great job, young coder! Your island is now ready for stealth missions.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/triad-infiltration-making-players-invisible-in-verse
  • https://dev.epicgames.com/documentation/en-us/uefn/triad-infiltration-5-making-players-invisible-in-verse
  • https://dev.epicgames.com/documentation/en-us/uefn/triad-infiltration-in-verse
  • https://dev.epicgames.com/documentation/en-us/uefn/triad-infiltration-10-final-result-in-verse
  • https://dev.epicgames.com/documentation/en-us/fortnite/triad-infiltration-in-verse

Get the complete code — free

You've read the full walkthrough. The complete, copy-paste-ready Verse solution is free for members — sign in to unlock it.

Free with your BrainDead.TV / BrainDeadGuild Discord account. The walkthrough above is always free.

Verse source files

Turn this into a guided course

Add triad-infiltration-making-players-invisible-in-verse 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