Overview
GetPlayers() is a method on fort_playspace (imported from /Fortnite.com/Playspaces) that returns []player — a Verse array containing every human player currently in the experience. NPCs and bots are excluded.
Reach for it whenever you need to:
- Loop over all players at round-start (health checks, score resets, spawn assignments)
- Find the lowest-health sailor to trigger a rescue cinematic
- Award points to every player simultaneously
- Count how many players are alive before ending a round
Because it's marked <transacts>, it can be called freely inside OnBegin, async tasks, and event handlers without any special effect annotations on your own functions.
API Reference
player
Full public surface, resolved verbatim from the live Epic digest (Verse.digest.verse). Inherited members are merged from agent.
player<native><public> := class<unique><persistent><module_scoped_var_weak_map_key><epic_internal>(agent):
team
Full public surface, resolved verbatim from the live Epic digest (Verse.digest.verse).
team<native><public> := class<unique><epic_internal>:
Walkthrough
Scenario — The Cove Cannon Salute: When the round begins, a cinematic cannon fires for every player on the pirate ship dock. Then the device checks each player's health (they all start full) and awards a score point to anyone above 50 HP — a warm-up bonus before the battle.
Place a cinematic_sequence_device and a score_manager_device in your island, then wire them to this Verse device via @editable fields.
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }
# Fires a cannon cinematic for every player at round start,
# then grants a bonus score to any player above 50 HP.
cove_cannon_salute := class(creative_device):
# Wire these in the UEFN Details panel
@editable
CannonCinematic : cinematic_sequence_device = cinematic_sequence_device{}
@editable
BonusScorer : score_manager_device = score_manager_device{}
OnBegin<override>()<suspends> : void =
# 1. Grab the playspace this device lives in.
Playspace := GetPlayspace()
# 2. GetPlayers() returns []player — every human in the session.
Players := Playspace.GetPlayers()
# 3. Loop over every player.
for (P : Players):
# 4. Play the cannon cinematic for this specific player.
# The agent overload targets just that sailor.
CannonCinematic.Play(P)
# 5. Cast player -> fort_character to read health.
# GetFortCharacter() is a <decides> method, so we use if.
if (Character := P.GetFortCharacter[]):
HP := Character.GetHealth()
# 6. Award a bonus score point if health is above 50.
if (HP > 50.0):
BonusScorer.Activate(P)
Line-by-line explanation
| Line | What it does |
|---|---|
GetPlayspace() |
Returns the fort_playspace for this creative_device. Every device has this built-in. |
Playspace.GetPlayers() |
The star of the show — returns []player of all humans right now. |
for (P : Players): |
Standard Verse array iteration; P is each player in turn. |
CannonCinematic.Play(P) |
Calls the agent overload of Play so the cinematic targets this individual sailor. |
P.GetFortCharacter[] |
Converts player → fort_character (failable, hence [] and if). |
Character.GetHealth() |
Returns the character's current HP as float. |
BonusScorer.Activate(P) |
Grants score points to this specific player via score_manager_device. |
Common patterns
Pattern 1 — Count alive players and end the round when only one remains
This pattern calls GetPlayers() inside a loop that polls every few seconds, useful for a last-sailor-standing mode on a lagoon map.
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }
lagoon_survival_manager := class(creative_device):
@editable
EndCinematic : cinematic_sequence_device = cinematic_sequence_device{}
OnBegin<override>()<suspends> : void =
# Poll until one sailor remains.
loop:
Sleep(5.0)
Playspace := GetPlayspace()
Players := Playspace.GetPlayers()
# Count players whose fort_character is still alive.
AliveCount : int = 0
for (P : Players):
if (Char := P.GetFortCharacter[]):
if (Char.GetHealth() > 0.0):
set AliveCount += 1
if (AliveCount <= 1):
# Fire the victory cinematic for everyone and stop polling.
EndCinematic.Play()
break
Key call: Playspace.GetPlayers() is called each tick of the loop so the count always reflects the current roster (players may have been eliminated since last check).
Pattern 2 — Respawn every player to the dock spawner at round reset
A timer expires, and every sailor gets teleported back to the ship's spawn pad — a classic round-reset flow.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }
dock_round_reset := class(creative_device):
@editable
DockSpawner : player_spawner_device = player_spawner_device{}
@editable
RoundTimer : timer_device = timer_device{}
OnBegin<override>()<suspends> : void =
# Subscribe to the timer's failure event (time ran out).
RoundTimer.FailureEvent.Subscribe(OnRoundEnd)
# Called when the timer fires — ?agent payload, so we unwrap it.
OnRoundEnd(MaybeAgent : ?agent) : void =
Playspace := GetPlayspace()
Players := Playspace.GetPlayers()
# Respawn EVERY player at the dock, regardless of who triggered the timer.
for (P : Players):
DockSpawner.SpawnPlayer(P)
Key call: GetPlayers() is used here inside an event handler (not OnBegin) — it's perfectly valid anywhere because it's <transacts>. The for loop then calls SpawnPlayer on each player directly.
Pattern 3 — Register every player with a player_reference_device at game start
Some devices (leaderboards, holograms) need an explicit Register call. Loop GetPlayers() to seed them all at once.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }
ship_leaderboard_seeder := class(creative_device):
@editable
PlayerRef : player_reference_device = player_reference_device{}
OnBegin<override>()<suspends> : void =
Sleep(1.0) # Brief wait so all players finish joining.
Playspace := GetPlayspace()
Players := Playspace.GetPlayers()
for (P : Players):
# Register each sailor so the hologram display tracks them.
PlayerRef.Register(P)
Key call: PlayerRef.Register(P) takes an agent; player is a subtype of agent so it passes directly — no cast needed.
Gotchas
1. GetPlayers() is a snapshot, not a live subscription
GetPlayers() returns the roster at the moment you call it. If you store the array and check it later, it will be stale. Always call GetPlayspace().GetPlayers() fresh inside loops or event handlers that need current data.
2. Call it on GetPlayspace(), not thin air
You cannot write GetPlayers() as a bare call. It is a method on fort_playspace. The pattern is always:
Playspace := GetPlayspace()
Players := Playspace.GetPlayers()
GetPlayspace() is a built-in method on creative_device — no @editable field needed.
3. player ≠ fort_character — you need a cast for physical actions
GetPlayers() gives you []player. To read health, apply forces, or check position you must convert to fort_character with P.GetFortCharacter[] inside an if block — it's failable because the character might not exist (e.g., the player is in the spectator state):
if (Char := P.GetFortCharacter[]):
HP := Char.GetHealth()
4. player IS an agent — no cast needed for device calls
Most device methods (Activate, Register, SpawnPlayer, etc.) accept agent. Because player is a subtype of agent, you can pass P directly. You only need the fort_character cast for character-level APIs.
5. Empty array is valid — guard your logic
If you call GetPlayers() before anyone has loaded in (e.g., immediately on OnBegin with no Sleep), you may get an empty array []. A for loop over an empty array simply does nothing — no crash — but logic that assumes at least one player (like finding a minimum-health player) should check Players.Length > 0 first.
6. Bots and NPCs are NOT included
GetPlayers() returns only human players. AI-controlled characters accessed via /Fortnite.com/AI are separate and won't appear in this array.