Reference Scene Graph compiles

team: Reading Teams & Attitudes on the Sunny Cove

The `team` type is the identity handle Fortnite hands out when you split players into sides — Pirates vs. Castaways on your sunny cove. You never call methods on `team` directly; instead you read and sort teams through the playspace's `fort_team_collection`. This article shows how to get a player's team, check attitudes, and hand out loot accordingly, all in one bright cel-shaded island moment.

Updated Examples verified on the live UEFN compiler

Overview

The team type is deceptively simple: it has no methods and no events of its own. It is a pure identity token — a handle that says "this side of the match." When your Island Settings device sets Teams to Team Index with a value of 2, Fortnite creates two team objects and drops every player onto one of them.

So how do you do anything with teams in Verse? You reach for the fort_team_collection interface from /Fortnite.com/Teams. You get it from the active playspace with GetPlayspace().GetTeamCollection(). That collection is where all the real verbs live:

  • GetTeams() — every team in the match.
  • GetTeam(InAgent) — which team a player is on.
  • GetAgents(InTeam) — everyone on a given team.
  • IsOnTeam(InAgent, InTeam) — a quick membership test.
  • AddToTeam(InAgent, InTeam) — move a player onto a team.
  • GetTeamAttitude(Team1, Team2) — Friendly / Neutral / Hostile.

Reach for the team collection whenever your game needs to treat the two sides differently: a vault on the cove that only opens for Pirates, a scoreboard tally, or a greeting banner that reads different text depending on which crew you joined. Think of team as the key and fort_team_collection as the lock that reads it.

API Reference

team

Full public surface, resolved verbatim from the live Epic digest (Verse.digest.verse).

team<native><public> := class<unique><epic_internal>:

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):

Walkthrough

The island moment: A pirate ship is docked at a sunlit cove. When a player steps on the boarding plank (a trigger_device), we look up which team they're on, count how many crewmates share that team, and print a welcome banner. Pirates who step aboard also get a treasure chest carryable spawned from a device on deck.

Drop into the level: one trigger_device (the plank), one carryable_object_spawner_device (the treasure chest on deck), and set Island Settings Teams to Team Index = 2.

using { /Fortnite.com }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }

cove_boarding := class(creative_device):

    # The plank the player steps on to board the ship.
    @editable
    BoardingPlank : trigger_device = trigger_device{}

    # A chest that spawns on deck for the boarding crew.
    @editable
    TreasureChest : carryable_spawner_device = carryable_spawner_device{}

    # Localized text helper — message params never take raw strings.
    Banner<localizes>(S : string) : message = "{S}"

    OnBegin<override>()<suspends> : void =
        # Subscribe the plank's trigger to our boarding handler.
        BoardingPlank.TriggeredEvent.Subscribe(OnBoarded)

    OnBoarded(Agent : ?agent) : void =
        # A listenable(?agent) hands us an optional agent — unwrap it first.
        if (BoardingAgent := Agent?):
            WelcomeCrew(BoardingAgent)

    WelcomeCrew(BoardingAgent : agent) : void =
        # Grab the team collection for the running experience.
        TeamCollection := GetPlayspace().GetTeamCollection()

        # GetTeam <decides> — it fails if the agent isn't on any team.
        if (PlayerTeam := TeamCollection.GetTeam[BoardingAgent]):
            # Count everyone who shares this team.
            if (Crew := TeamCollection.GetAgents[PlayerTeam]):
                CrewSize := Crew.Length
                Print("Welcome aboard! Your crew has {CrewSize} members.")

                # The first team in the list is our "Pirates" side — reward it.
                AllTeams := TeamCollection.GetTeams()
                if (Pirates := AllTeams[0], TeamCollection.IsOnTeam[BoardingAgent, Pirates]):
                    TreasureChest.Spawn()
                    Print("Ahoy, Pirate! A chest has appeared on deck.")```

**Line by line:**

- The two `@editable` fields let you wire the placed plank and chest spawner in the UEFN Details panel. Without declaring the device as a field you can't call its methods — a bare `TreasureChest.Spawn()` would fail with *Unknown identifier*.
- `Banner<localizes>(...)` is our converter for `message` params. There is no `StringToMessage` in Verse — a `<localizes>` function is the supported way to turn a string into a `message`.
- In `OnBegin`, `BoardingPlank.TriggeredEvent.Subscribe(OnBoarded)` hooks our method to the plank. Event handlers are ordinary class methods.
- `OnBoarded` receives `(Agent : ?agent)` because the trigger event is `listenable(?agent)`. We unwrap with `if (BoardingAgent := Agent?)` before using it.
- `GetPlayspace().GetTeamCollection()` is the single entry point to everything team-related.
- `GetTeam[BoardingAgent]` uses square brackets because it is `<decides>` — it can fail (a spectator or unassigned agent). The `if` handles that gracefully.
- `GetAgents[PlayerTeam]` returns the array of crewmates; `.Length` gives the head-count.
- `GetTeams()` returns all teams; `AllTeams[0]` indexes the first (also failable, hence inside the `if`). `IsOnTeam[...]` confirms our booarder is on that Pirate team before we `Spawn()` the chest.

## Common patterns

### Check attitude before opening a vault

Use `GetTeamAttitude` to decide whether two teams are friends or foes. Here a trigger checks whether the boarder is friendly toward the ship's owning team (team 0) before firing a cannon salute log.

```verse
using { /Fortnite.com }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }

salute_gate := class(creative_device):

    @editable
    SignalPlate : trigger_device = trigger_device{}

    OnBegin<override>()<suspends> : void =
        SignalPlate.TriggeredEvent.Subscribe(OnStepped)

    OnStepped(Agent : ?agent) : void =
        if (Visitor := Agent?):
            TeamCollection := GetPlayspace().GetTeamCollection()
            AllTeams := TeamCollection.GetTeams()
            if:
                ShipCrew := AllTeams[0]
                VisitorTeam := TeamCollection.GetTeam[Visitor]
                Attitude := TeamCollection.GetTeamAttitude[ShipCrew, VisitorTeam]
            then:
                if (Attitude = team_attitude.Friendly):
                    Print("Friendly crew aboard — fire the salute!")
                else if (Attitude = team_attitude.Hostile):
                    Print("Enemy boarders! Sound the alarm!")
                else:
                    Print("A neutral wanderer steps aboard.")

Move a player onto the Castaway team

AddToTeam reassigns a player at runtime — handy for a "walk-the-plank" volume that exiles you to the other crew.

using { /Fortnite.com }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }

plank_exile := class(creative_device):

    @editable
    ExileVolume : trigger_device = trigger_device{}

    OnBegin<override>()<suspends> : void =
        ExileVolume.TriggeredEvent.Subscribe(OnExiled)

    OnExiled(Agent : ?agent) : void =
        if (Castaway := Agent?):
            TeamCollection := GetPlayspace().GetTeamCollection()
            AllTeams := TeamCollection.GetTeams()
            # Second team on the list = the Castaways.
            if (CastawayTeam := AllTeams[1]):
                if (TeamCollection.AddToTeam[Castaway, CastawayTeam]):
                    Print("You've been marooned with the Castaways!")

Tally each side's crew at round start

Combine GetTeams and GetAgents to print a roster the moment the round begins, using GetFortRoundManager.

using { /Fortnite.com }
using { /Fortnite.com/Game }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Simulation }

crew_roster := class(creative_device):

    OnBegin<override>()<suspends> : void =
        if (RoundManager := GetPlayspace().GetFortRoundManager[]):
            RoundManager.SubscribeRoundStarted(OnRoundStarted)

    OnRoundStarted()<suspends> : void =
        TeamCollection := GetPlayspace().GetTeamCollection()
        for (OneTeam : TeamCollection.GetTeams()):
            if (Crew := TeamCollection.GetAgents[OneTeam]):
                Print("A crew of {Crew.Length} sets sail.")

Gotchas

  • team has no methods. Do not try PlayerTeam.GetAgents() — that fails to compile. All verbs live on fort_team_collection, reached via GetPlayspace().GetTeamCollection().
  • Most collection calls are <decides>. GetTeam, GetAgents, IsOnTeam, AddToTeam, and GetTeamAttitude all use square-bracket calls inside an if — they fail rather than crash when an agent has no team or a team isn't in the collection. GetTeams() (plural) is the exception: it returns a plain array with parentheses.
  • Array indexing can fail too. AllTeams[0] and AllTeams[1] are failable expressions — wrap them in if (or an if:/then: block) so an empty team list doesn't break the flow.
  • Set up teams in Island Settings first. If Teams is left at No Teams, GetTeams() returns everyone on one team and AllTeams[1] fails. Configure Team Index = 2 (or more) before expecting two crews.
  • Unwrap the agent. Trigger events give you ?agent; always if (A := Agent?) before passing to team functions, which take a non-optional agent.
  • message needs a <localizes> function. Any device text (banners, HUD) must be a message, never a raw string — declare a Banner<localizes>(S:string):message = "{S}" helper as shown.

Guides & scripts that use team

Step-by-step tutorials that put this object to work.

Build your own lesson with team

Generate a personalized, step-by-step lesson plan built around this object — grounded in this exact reference and our compile-verified knowledge base.

Build a lesson →