VerseIsland
Feed Learn Leaderboard Guides Reference Explore Search Docs Verse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Fortnite › Verse Language · Up to Fortnite · Verse Language · 22 of 570 in Verse Language
Browse Fortnite

Case in Verse

With case expressions, you can control the flow of a program from a list of choices. The case statement in Verse is a way to test one value against multiple possible values (as though you were using =), and running code based on which one matches.

The use of case expressions can be found in all kinds of applications, like in games where there is a non-playable character (NPC).

For example, let's say you use the Guard Spawner device to spawn a guard with its patrol option enabled. After the guard spawns into the game, it has a few possible active states, including Idle, Patrol, Alert, Attack, and Harvest. A high-level state-transition diagram for this could look like:

In-game state transition in Verse

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in
    📄
    Source
    Epic Games

    © Epic Games. Official Epic developer documentation, shown here as a reference with a link to the original. All rights remain with Epic Games. Terms ↗

    View original Sources & licensing
    Request removal
    Last updated Mar 8, 2026
    Keep exploring
    More in Verse Language · 22 of 570
    Prev
    branch in verse
    Next
    code blocks in verse
    Browse all files in this folder (A–Z)
    Next up
    • With `case` [expressions
    • Fortnite Creative Glossary
    • For example, let's say you use the [Guard Spawner
    • Structure
    Related topics
    • Verse Language Quick Reference Verse Language
    • Control Flow In Verse Input & Controls
    • Expressions In Verse Verse Language
    • Verse Glossary Verse Language
    • Team Elimination Game In Verse Player

    Related

    Open in graph →

    Linked docs

    • Verse Glossary

    Related topics

    • Verse Language Quick Reference
    • Control Flow In Verse
    • Expressions In Verse
    • Verse Glossary
    VerseIsland · an archipelago of Verse & UEFN knowledge
    🗺️ Island atlas Learn Guides History About & Press Sources & Licensing Status

    Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

    🦜

    Scout · your island guide

    The Isle of Verse