/// <summary> /// Action after join in room /// </summary> void OnJoinedRoom() { Vector3 position = new Vector3(-3.2f, 1.5f, -0.9f); GameObject newPlayer = PhotonNetwork.Instantiate("Goblin", position, Quaternion.identity, 0); TargetPlayer.target = newPlayer.transform; NewPlayer = newPlayer; PlayerFireComponent = NewPlayer.GetComponentInChildren <Fire>(); newPlayer.gameObject.name = string.Format("Goblin {0}", Random.Range(1, 100)); }