Clear player RPCs (Network problems)

When player connect to server, he sends some RPCs. After player is killed he spawns again, and send RPCs again. My problem is after couple of killings the fps is constantly deacrease and game lags too much. What i want is to clean player RPCs each time he being killed.

I was trying to use this:

function Die{
Network.RemoveRPCs(gameObject);
var clone : Transform;
clone = Instantiate(deadReplacement, location, transform.rotation) as Transform;
Destroy(gameObject);
}

But this code seems dont work.

I believe there’s a basic networking tutorial on Youtube which has a tutorial on this. You should go check it out, just search “Unity networking tutorial”.

The main problem is there are only basic tutorials for beginners. My question require a little bit advanced knowledge of Networking

Agreed , networking is one of those not well documented features of Unity. Not to say there is not any sources out there. But definately, someone could do a better job at presenting the information, than those that have so far. The only one that really seems to cover a fair bit of the core is the M2H networking series, and unfortunately, as he rewrote and made it better, he lso added a price tag to it.

Anyways , good luck!.

I would say that clearing a networked players RPC’s is basic networking. Seeing as it is standard for any networked game.

So if you know any tutorial that cover this, could you possibly post a link?