What is the proper way to handle a player leaving a server during a game match? Currently, I have the OnPlayerDisconnected method as follows.
void OnPlayerDisconnected(NetworkPlayer player){
Network.RemoveRPCs (player);
print ("Player has left. Destroying their objects");
Network.DestroyPlayerObjects (player);
}
However this still throws the error **Couldn't send RPC function** twice after the player leaves. The RPC that it is failing to send is a RPCMode.All from the host.
**Edit**: When a player leaves, the host still tries to send a RPC to the disconnected player for about two frames. Is there any way to stop the host's gameobjects from sending the RPC's to the objects that will soon be disconnected
↧