Im using unity3D pls help me,,,How to fix this code? this code work can teleport to player but not targeting player/random player,I want to teleport to another player with iD like , ./tp 1 so will teleport to player with ID 1,,,, here is my code
- if (this.inputLine.StartsWith("/tp"))
- {
- foreach (GameObject obj22 in GameObject.FindGameObjectsWithTag("Player"))
- {
- PhotonPlayer player18 = PhotonPlayer.Find(Convert.ToInt32(this.inputLine.Remove(0, 5)));
- objArray25 = GameObject.FindGameObjectsWithTag("Player");
- for (num59 = 0; num59 < objArray25.Length; num59++)
- {
- GameObject obj7 = objArray25[num59];
- if (obj22.GetComponent<HERO>().photonView.isMine)
- {
- obj22.GetComponent<HERO>().transform.position = obj7.GetComponent<HERO>().transform.position;
- }
- }
- }
- }
pleasw help