When I call PlayerJoined with RPCMode.All, it crashes the game for whoever calls it. When I call StatUpdater for all, it crashes whoever didn't call it. I assume it would apply to all users but have never tried it with more than two.
All the arrays referenced but not declared in my sample are public and declared with length 8. When I call StatUpdater and crash the other users, it does log "hmm". Can anyone tell me why this is happening?
`[RPC]
void StatUpdater (int[] kill, int[] death, string[] name, string[] chats){
Debug.Log ("hmm");
playerKills = kill;
playerDeaths = death;
playerNames = name;
chatLog = chats;
}
[RPC]
void PlayerJoined (){
if (Network.isServer) {
Debug.Log ("hmm");
names = playerNames;
chat = chatLog;
kills = playerKills;
deaths = playerDeaths;
GetComponent().RPC ("StatUpdater", RPCMode.Others, kills, deaths, names, chat);
}
}`
Edit: I ended up just giving up on this and changing the function entirely but am still curious to know why this doesn't work.
↧