private void TeleportPlayer(int LocIndex) { PlayerScript player = FindObjectOfType <PlayerScript>(); Teleport teleport = FindObjectOfType <Teleport>(); Vector3 dest = teleport.GetLocation(LocIndex); player.teleport(dest); }