- When the fraction is 0 you are at the start
- When the fraction is at 1 you are at the end
- When the fraction is at 0.5 you are halfway
But if we replace the fraction with something non linear as long as its a function that returns a result in the range 0..1 we can get some more interesting results. Trig curves like Sine are a good candidate and allow the creation of movement that has smooth acceleration and deceleration.
//When something scary happens momentarily zoom the camera
float inter = (1.0f*fearCounter)/FEARCOUNTER; //linear
inter = Mathf.Sin(inter);
float fov = Mathf.Lerp(cameraFOV,cameraFOV/2.0f, inter);