IEnumerator WaitToOpen(GameObject player) { if (hasAnim) { anim.SetBool("Open", true); } CharMovement playerMove = player.GetComponent <CharMovement>(); if (player.GetComponentInChildren <Push>()) { player.GetComponentInChildren <Push>().UnChild(); } playerMove.setCanMove(false); playerMove.moving = false; playerMove.speed = 2f; yield return(new WaitForSecondsRealtime(0.5f)); fadeAnim.SetTrigger("Fade"); player.transform.position = doorDestiny.transform.position; playerMove.setCanMove(true); playerMove.moving = true; playerMove.speed = 2f; }