Network.Destroy and RPC buffer

Hi all!

Ok, Maybe there is something i am doing the wrong way in my code, but it seems that RPC calls buffered on Network.Instantiate are not removed from the RPC buffer by calling Network.Destroy.

Players that connect after an object has been network destroyed do receive the RPC call for something that does not exist any more. Is it the expected behavior ? Is there something I should be aware of?

Thanks for your help!

Sebastien

You need to clear out the RPC buffer for that player:

function OnPlayerDisconnected(player: NetworkPlayer) {
   Debug.Log("Clean up after player " + player);
   Network.RemoveRPCs(player);
   Network.DestroyPlayerObjects(player);
}

file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Network.OnPlayerDisconnected.html