Lerp returning max value halfway

Hello, well my problem seems to be quite common and yet I haven’t been able to fix it… degrees and robotjoints are float values, in an array, but are simple floats.

Lerp is misbehaving, I think… the code is the next:

private IEnumerator MoveJoints(float[] degrees, float speed) {
    float t = 0.0f;
    while (t < 1) { 
        t += Time.deltaTime * speed;
        for (int i = 0; i < robotJoints.Length; i++) {
            robotJoints <em>= Mathf.Lerp(robotJoints_, degrees*, t);*_</em>

}
Debug.Log("In " + t.ToString() + " the value is " + robotJoints[0].ToString() + " aiming for " + degrees[0].ToString());
yield return null;
}
done = true;
}
I can see with the debug that the value of robotjoints[0] becomes the same as degrees[0] when t is 0.5 or higher… shouldn’t it be at 1?
What am I not seeing?

This is likely because you are passing the lerp function the first param as the updated float value on every iteration. You need a constant float value as the start float to do a linear interpolation. Since the interpolation is not linear with your code, you are getting the results as is. Try passing the start float that stays constant until your reach 1.0f and this will likely not happen.