Hi ther e, i have a little bit of RPC code giving me a huge headache. I send a RPC across to damage players when shot, but the thing is, if the player is killed and an RPC has been sent just shortly after (because his calculation of death is still taking place) i get the null reference error, and no matter wha ti try , i cant handle it. I have tried
if(networkView.InQustion == null)
return;
That doesnt work at all… so tried searching for the gameObjec that it would have been attached to , but of course its null , and that doesnt seem to catch either… so no matter what happens , it comes back null , and the player just locks up
@RPC function RecievePain(d : int, player : NetworkViewID){
var wID : WeaponID = new WeaponID();
wID.index = d;
wID.player = player;
var p : GameObject = NetworkView.Find(player).gameObject;
if(p == null)
return;
if(p != null)
p.SendMessage("RecievePain", wID, SendMessageOptions.DontRequireReceiver);
}
.