Skip to main content

Player Management

Handling players -- connecting, spawning, identifying, and occasionally removing them -- is a core part of any multiplayer world. Here's how HELIX gives you control over the player lifecycle.

Player Connections

When a player connects to your world, the server fires an event you can hook into. This is where you set up their character, load their data, or send them a welcome message.

Blueprint Handle new player login: spawn and possess a characterScroll to zoom · Drag to pan · Drag nodes to move
Event OnPostLoginNew PlayerGet Random Spawn PointLocationSpawn Actor from ClassClassMyCharacterSpawn LocationActorPossessTargetIn PawnPrint StringIn String"Player connected"

Getting Player Info

Every connected player has a unique ID, a display name, and various properties you can query.

Blueprint Get player name, ID, and pingScroll to zoom · Drag to pan · Drag nodes to move
Get Player NameTargetPlayerControllerNameGet Unique Net IDTargetPlayerControllerIDGet PingTargetPlayerControllerPing

Iterating Over Players

Need to loop through everyone online? Maybe for a scoreboard, or to apply an effect to all players:

Blueprint Loop through all connected playersScroll to zoom · Drag to pan · Drag nodes to move
Event BeginPlayGet All PlayersPlayersFor Each LoopArrayLoop BodyCompletedArray ElementArray Index

Kicking Players

Sometimes you need to remove someone -- whether it's for bad behavior or because the round ended.

Blueprint Kick a player with a reason messageScroll to zoom · Drag to pan · Drag nodes to move
Event BeginPlayGet Game ModeGame ModeKick PlayerTargetPlayerPlayerControllerReason"Kicked by admin"

Disconnect Handling

Don't forget to clean up when players leave. Destroy their character, save their data, and free up resources.

Blueprint Save player data on disconnectScroll to zoom · Drag to pan · Drag nodes to move
Event LogoutExitingSave Player DataPlayer

Always handle disconnects gracefully -- players can drop unexpectedly due to network issues, not only from intentional logouts.