Updated SpawnPlayerCustom.md

This commit is contained in:
Rodol Phito 2019-03-08 22:22:04 -08:00
parent 0b7d326007
commit a00a46cc83

View File

@ -26,11 +26,11 @@ using Mirror;
public class MyNetworkManager : NetworkManager
{
public override void OnServerAddPlayer(NetworkConnection conn)
public override void OnServerAddPlayer(NetworkConnection conn, AddPlayerMessage extraMessage)
{
GameObject player = (GameObject)Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
player.GetComponent<Player>().color = Color.red;
NetworkServer.AddPlayerForConnection(conn, player, conn.playerControllerId);
NetworkServer.AddPlayerForConnection(conn, player);
}
}
```