How can you properly get/set the tags of GameObjects created from a nonlocal client?

I’m using photon unity networking (PUN) to instantiate prefabs on the network. The prefabs start untagged, so I tag them immediately after being instantiated like this:

void soldier_spawn() {
        GameObject soldier_clone = PhotonNetwork.Instantiate("soldier",    gameObject.transform.position,  gameObject.transform.rotation,0);
        soldier_clone.tag = gameObject.tag;
    }

this is within a script attached to my “spawn object” prefab. So it simply assigns the tag and relevant transform information of that object so things will spawn from there. Locally, this seems to function fine, on nonlocal clients however, the gameobjects are all untagged. Anything at all not tagged locally seems to be untagged. So how can I address this? Currently my game is setup to have the AI of those tagged “Team 1” to find those tagged “Team 2” and attack them, and vice versa. So tags not working is a major setback.

Well after being stuck on this problem for 2 days, I have finally learned (at least the basics) about RPC’s and how to use them to handle things like this.

I solved this by going into my prefab “soldier” and in one of it’s scripts I added:

[PunRPC]
    void soldierTagger(string text)
    {
        this.tag = text;
    }

then I simply call that script within the start() like this:

photonView.RPC("soldierTagger", PhotonTargets.All, gameObject.tag);

and this sets the tag appropriately across all connected players. Just an fyi for future searchers, you need to inherit from Photon.Monobehavior or Photon.PunBehaviour to be able to access “photonView.RPC”. Hopefully this helps people who are stumped as I was.