RPC dont get to right destination...


I got Player A and B.

When players attack they fire a function.
In this fonction there is that :

[code2=csharp]enemyTarget = hit.transform.gameObject;
photonView.RPC("LifebarUpdater", enemyTarget.GetComponent<PhotonView>().owner, -damageMade);[/code2]

On an other script:

void LifebarUpdater( int changingAmount){

test = "touched!";
lifePercent = (changingAmount*100)/maxLife;
lifeBarXSize = lifeBarMaxXSize*(lifePercent/100);


When A attacks B on owned connection nothing happens.
But on remote connection, A seems to be touched, looks like A is sending to A the RPC instead of A to B.

Any help please ?



  • I am looking around on the Angrybot example and wonder why is the script asking for masterClient to update the HP:
    Health.JS - line 97

    // Die if no health left
    if (health <= 0) {
    view.RPC("Die", PhotonTargets.AllBuffered);
    view.RPC("Die", PhotonTargets.All);

    var diff : float = lastSharedHP - health;
    view.RPC("SetHP", PhotonTargets.Others, health);

    and how is the information spread, as it looks like the "AutoFire.js" only changes the health on one Player, if this player is not masterClient, how is the changing health information sent ?