public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
{
//base.OnServerAddPlayer(conn, playerControllerId);
for (int i = 0; i < SpawnPoints.Count; i++)
{
if (SpawnPoints[i].Occupied == false)
{
//init
//base.OnServerAddPlayer(conn, playerControllerId);
GameObject player = (GameObject)Instantiate(playerPrefab, SpawnPoints[i].Point.position, SpawnPoints[i].Point.rotation);
player.name = "Player_" + i;
//playerTracker.Add(player);
SpawnPoints[i].PlayerGO = player;
SpawnPoints[i].uID = i;
SpawnPoints[i].Occupied = true;
//set on player
aPlayer tPlayer = PathAddPlayer(new aPlayer("Player_" + i.ToString(), i, i, 1));
player.GetComponent<CarControl>().MyPlayer = PlayerList[i];
NetworkServer.AddPlayerForConnection(conn, player, playerControllerId);
//NetworkServer.SendToClientOfPlayer(player, MsgType.UpdateVars, null);
//player.GetComponent<CarControl>().RpcCallFromServerOnClient(player, tPlayer, SpawnPoints);
return;
}
}
}
The Values are set perfektly on Server side but on client there are no values even the name of the PlayerGameObject ist (Clone)
Anyone knows how to sync this on spawn?