Why will the following RPC function always replace instead of add objects to the list? Both server and client will have the same listOfPlayers
with the Count
of 1.
[RPC]
private void CreatePlayerSlot()
{
NetworkUser tempPlayer = new NetworkUser(); // create player
tempPlayer.netID = Guid.NewGuid(); // unique identifier
tempPlayer.ready = false; // player is ready or not
tempPlayer.active = false; // occupied or not
listOfPlayers.Add(tempPlayer);
}
I call this one everytime a player creates or joins a game.