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.