Search Unity

Third Party PhotonView: Stream player tag to every player in the room

Discussion in 'Multiplayer' started by ibouchallikht, Feb 18, 2017.

  1. ibouchallikht

    ibouchallikht

    Joined:
    May 1, 2016
    Posts:
    3
    Okay, so I have a playerprefab contains a healthbar.

    public float health;
    public float damage;

    void Start () {
    health = 100.0f;
    damage = 30.0f;
    }

    void Update () {
    if (health > 0){
    transform.tag = "Player";
    }
    else if (health < 0) {
    transform.tag = "Death";
    }
    }

    ... (rest of the script)

    As you can see, the prefab tag changes when health <0.
    But I want it to stream to all other players.
    If there are 2 players inside the game. only the tag of the player who died changes, which is normal. But for the other player, the tag of the player who died stays at "Player". I need it also to change to death.
    Someone who can help me out?

    Thanks
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066