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:)
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;
}
}