Enemy / friend bar

Hi.
‘Small’ problem:

GameObject OthersBar;
public int myTeam; //- may be a string or enum - int just for easy testing

    void Start () {
        if (m_PhotonView.isMine == true) {
            createPlayerGUI ();
        }
        else{
            createOthersBar ();
        }
    }

    void createOthersBar (){
        OthersBar = (GameObject) Instantiate(OthersBar_prefab, new Vector2(0,0), Quaternion.identity);
        OthersBar.GetComponent<OthersBar_scr> ().HP = PlayerHP;
        OthersBar.GetComponent<OthersBar_scr> ().Name = PlayerName;
        if(myTeam == ????? Problem ?????) {
              OthersBar.GetComponent<OthersBar_scr> ().Relation = "friend";
        }
        else{
              OthersBar.GetComponent<OthersBar_scr> ().Relation = "enemy";
       }
    }

Problem - how to check if our team is the same as the m_PhotonView.Owner we are currently in?

Sure, easy way is to set if myTeam == 1 then bar color red
but then it will looks stupid when our whole team will have f.e. red color because we are part of red team and enemys will have green bars.

SOLVED :slight_smile:

in CreateOthersBar added function foreach gameobject player with tag player
and two statements
if player id != PlayerID - create bar
if player.team != myTeam - status enemy else friend

hope this helps someone