private IEnumerator StartWitchEncounter(Witch attacking, Witch leaving) { MyAudio.PlayBackgroundMusic(WitcherFightMusic); var leavingTransform = leaving.transform; var witcherTransform = WitcherMotor.transform; WitcherMotor.MoveTo(leaving.transform.position); while ((leavingTransform.position - witcherTransform.position).magnitude > 1) { yield return null; } leaving.OpenPortal(); while (Vector3.Distance(leavingTransform.position, witcherTransform.position) > 0.2f) { yield return null; } leaving.gameObject.SetActive(false); WitcherMotor.gameObject.SetActive(false); attacking.StartFight(); }