float value;
IEnumerator SmoothLerp(float start, float end, float duration)
{
float time = 0;
while (time < duration) {
float t = time / duration;
value = Mathf.Lerp(start, end, t); // Use value to store result
time += Time.deltaTime;
yield return null;
}
value = end; // Set to final value
}