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

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 documentation

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

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

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)

Source

Epic Games documentation

View original

Last updated 2026-03-08T05:10:13.840236+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

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