private IEnumerator ZoomCam(int position) { blockInput = true; Reset(); int oldPos = cameraPosition; float elapsedTime = 0; float time = timeToMoveDoor; Vector3 startingPos = cameraPositions[oldPos].position; Vector3 newPos = doorPositions[position].position; float origSize = sceneCamera.orthographicSize; while (elapsedTime < time) { sceneCamera.transform.position = Vector3.Lerp(startingPos, newPos, (elapsedTime / time)); sceneCamera.orthographicSize = Mathf.Lerp(origSize, 0.001f, (elapsedTime / time)); elapsedTime += Time.deltaTime; yield return(1); } sceneCamera.transform.position = newPos; sceneCamera.orthographicSize = 0.001f; fadeImage.canvasRenderer.SetAlpha(1); fadeImage.CrossFadeAlpha(1, 0, true); yield return(new WaitForSeconds(transitionTime)); // Call the GM func here ML.EnterDoor(position); Reset(); fadeImage.CrossFadeAlpha(0, timeToFade, false); blockInput = false; }