Only one client can see enemy hp bars

Hi, I use photon networking for my game. I instantiate 3 enemies when I start up a server. I use Physics.overlapsphere to detect if a gameObject with tag: Player is inside the overlapsphere. `

`

It works fine on the first connected player, however the second connected player cannot see the enemies’ hp bars. When I walk up to the enemies on the second client I can see the hp bars on the first client, not on the second client. That’s my problem. I have searched for days for a solution for this. I would really appreciate it if anyone could help me with this. It’s driving me crazy… :frowning:

 Collider[] col =
     Physics.OverlapSphere(transform.position,
     10);
                 		for (int i=0; i<col.Length; i++) {
                 			if(col*.tag == "Player") {*
  •  			showHealthbar=true;*
    
  •  		float distanceCol = Vector3.Distance(transform.position,*
    

GetComponent().transform.position);

  •  		if(distanceCol > 10) {*
    
  •  			showHealthbar=false;*
    
  •  		}*
    
  •  	}*
    
  •  }*
    

I actually figured it out. I had an if statement: if(enemies != null && enemies*.showhealthBar) and I figured out that player 2 had the enemies array nulled, it was nothing in it, because it only searched for enemies when player 1 got into the game! So I just put it like this in the Update function: enemies = GameObject.FindGameObjectsWithTag(“Enemy”);*
Now I can finally see hp bars on both clients!