Hi, I’m trying to send an RPC to my online teammate with an integer. Basically, I know the integer makes it to the right player because the “count value 2” Debug.Log prints the correct updated value(5) but in the Update() function the “count value” Debug.Log continues to print 0. Why isn’t the count variable being modified outside of the receiver function? This has been killing me all day, thank you so much for any help you can offer. Heres the basic code, thanks again EDIT: I ment to say teammate in the title not enemies…
int count = 0;
void Update(){
Debug.Log("count value: " + count);
}
void Sender(){
int abc = 5;
photonView.RPC("hitObject2", friendlyPlayer.GetComponent<PhotonView>().owner, abc);
}
[RPC]
void Receiver(int number){
count = number;
Debug.Log("count value 2: " + count);
}