How to make enemy chase after character with specific tag other than the masterclient ( PHOTON UNITY)

I am trying to make the enemy chase all the users with specific tag as “Player”, however, the enemy only chases the MASTER CLIENT and not all the other users even though they all have “PLAYER” as a tag.

Can someone help?

 void FindTarget() {
    target = GameObject.FindWithTag("Player");

}

void Update()
{
  FindTarget();
    if (target == null) {
        FindTarget();
    }

else {
        -- chase enemy code --
            }
  • I see that you are changing the target only if it is null, so if your master client didn’t get destroyed the enemy will always continue chasing the same one (your master client)

  • also remember that GameObject.FindWithTag will always return the first in your hierarchy; so better to get all list of players GameObject.FindGameObjectsWithTagand then get random object from this list.