Replenish Own Player's Health without affecting other fellow Players

Options
My goal is simple:

When the player picks up a health kit, it replenishes his health back to 100.

I have this code:

[PunRPC] public void ReplenishHealth(int newHealth) { playerHealth = newHealth; isPlayerAlive = true; Debug.Log("Called!"); }

That will be called when I encounter a health kit:

PhotonView pViewOwn = transform.GetComponent<PhotonView>(); pViewOwn.RPC("ReplenishHealth", RpcTarget.AllBuffered, 100);

However, in doing this, I affect all other player's health as well. I just want my own player to get its health to 100, and then broadcast to everyone that "hey, my health is now full".

Comments