Lerping orthographic camera size jitters

Hi When I try to Lerp the orthographic camera size it makes a nasty jitter at the end instead of a smooth Lerp. I have no idea why, so help would be much appreciated:)
171376-ezgifcom-video-to-gif.gif

Here is my code:

void Update()
	{

		StartCoroutine(Zoom(5,2,0.5f));

	}

	IEnumerator Zoom(float oldSize, float newSize, float time) 
	{
        
		float elapsed = 0;
     while (elapsed <= time)
     {
		 float speed = 0.5f;
         elapsed += Time.deltaTime * speed;
         float t = elapsed / time;
 
         Camera.main.orthographicSize = Mathf.Lerp(oldSize, newSize, t);
         yield return null;
     }
		 
    }

So I kind of found the problem, just leaving this here for future reference.

It does not like to get the Lerp in the Update, Because I’m guessing it gets called a lot - hence the jitter.
In my game I only need it to zoom in the beginning of a level, so the solution was just to put coroutine in Start.
If you need it to happen mid game it should be set of by a one time trigger I guess :slight_smile: