Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NetworkManager.OnServerAddPlayer

Switch to Manual
public function OnServerAddPlayer(conn: Networking.NetworkConnection, playerControllerId: short): void;

Parameters

conn Connection from client.
playerControllerId Id of the new player.

Description

Called on the server when a client adds a new player.

The default implementation for this function creates a new player object from the playerPrefab.