# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/triad-infiltration-5-making-players-invisible-in-verse
# Local doc: epic-docs/documentation/en-us/uefn/triad-infiltration-5-making-players-invisible-in-verse.md
# Section: Calling Invisibility Manager from Triad Infiltration Game
OnBegin<override>()<suspends>:void =
# Get all the Teams
set Teams = GetPlayspace().GetTeamCollection().GetTeams()
# Save the teams to later reference them
set MaybeInfiltrators = option{Teams[0]}
set MaybeAttackers = option{Teams[1]}
set MaybeDefenders = option{Teams[2]}
if:
Infiltrators := MaybeInfiltrators?
Attackers := MaybeAttackers?
Defenders := MaybeDefenders?
Logger.Print("Found all three teams")
set TeamsAndTotals[Infiltrators] = MaximumInfiltrators
set TeamsAndTotals[Attackers] = MaximumAttackers
set TeamsAndTotals[Defenders] = MaximumDefenders
Logger.Print("Set all three teams in TeamsAndTotals")
then:
#Subscribe to PlayerAddedEvent to allow team rebalancing when a new player joins the game
GetPlayspace().PlayerAddedEvent().Subscribe(OnPlayerAdded)
for(PlayerSpawner:PlayersSpawners):
PlayerSpawner.SpawnedEvent.Subscribe(OnPlayerSpawn)
BalanceTeams()
Logger.Print("Teams balanced, calling invisibility script")
InvisibilityManager.StartInvisibilityManager(Teams,AllPlayers, Infiltrators)
TeleportPlayersToStartLocations()
Verse Library
verse
16 Calling Invisibility Manager From Triad Infiltrati
Initializes device state on game start, references teams, subscribes to events, and launches invisibility logic.
extracted-snippets/documentation/en-us/uefn/triad-infiltration-5-making-players-invisible-in-verse/16-calling-invisibility-manager-from-triad-infiltrati.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.