public IEnumerator WaitForTransition() { //case boss room DestroyEnemys(); if (currentScenario.bossScenario) { yield return(new WaitForSeconds(0f)); currentScenario.isChanging = true; currentScenario.LeftCollider.enabled = true; currentScenario.RigthCollider.enabled = true; ChangeScene(); CameraMovement currentCamera = Camera.main.GetComponent <CameraMovement>(); currentCamera.ChangeCheckPoints(); currentCamera.ChangeCameraMovement(); } //case door transit else if (currentScenario.doorTransit && !currentScenario.holeTransit) { SimonActions.simon.SetTransition(); yield return(new WaitForSeconds(3f)); currentScenario.isChanging = true; currentScenario.LeftCollider.enabled = true; currentScenario.RigthCollider.enabled = true; ChangeScene(); CameraMovement currentCamera = Camera.main.GetComponent <CameraMovement>(); currentCamera.transform.position = currentScenario.StartCameraPosition; currentCamera.ChangeCheckPoints(); currentCamera.ChangeCameraMovement(); SimonActions.simon.transitioning = false; } //case hole transit else if (!currentScenario.doorTransit && currentScenario.holeTransit) { SimonActions.simon.SetTransition(); if (i == 3) { print("GotHere1"); TeleportSimon(); } yield return(new WaitForSeconds(3f)); SimonActions.simon.rigidbody.isKinematic = false; currentScenario.isChanging = true; currentScenario.LeftCollider.enabled = true; currentScenario.RigthCollider.enabled = true; ChangeScene(); CameraMovement currentCamera = Camera.main.GetComponent <CameraMovement>(); currentCamera.transform.position = currentScenario.StartCameraPosition; currentCamera.ChangeCheckPoints(); currentCamera.ChangeCameraMovement(); SimonActions.simon.transitioning = false; } //case castle transit else if (!currentScenario.doorTransit && !currentScenario.holeTransit) { SimonActions.simon.SetTransition(); yield return(new WaitForSeconds(3.5f)); currentScenario.isChanging = true; currentScenario.LeftCollider.enabled = true; currentScenario.RigthCollider.enabled = true; ChangeScene(); CameraMovement currentCamera = Camera.main.GetComponent <CameraMovement>(); currentCamera.transform.position = currentScenario.StartCameraPosition; currentCamera.ChangeCheckPoints(); currentCamera.ChangeCameraMovement(); SimonActions.simon.transitioning = false; } }