Coroutines are functions useful to implement tasks that need to happen across multiple frames. In this post we will see how to make the camera animate from one point to other across some time, the amount of time will be set in a variable so it can be changed. The function will be called when the user press the space bar. void Update () { if (Input.GetKeyDown(KeyCode.Space)) { if(func!=null) StopCoroutine(func); func = StartCoroutine(smoothMoveCamera());// moveCamera()); } } We need some variables in the class: public float duration = 2.0f; public float xStart = -5.0f; public float xFinish = 5.0f; Coroutine func; The first variable sets the number of seconds the animation will endure. Second ...