# Lerp speed or lerp time [closed]

Am I right about the fact that lerping can be done over a set period of time or at a speed which will continue until the target is reached?

How are the formulas for the two? Is it something like this?

LERP at speed:

// does not use start value but instead current value
newValue= Lerp (currentValue, targetValue, Time.deltaTime * speed);


LERP over set duration:

//uses startValue and calculates the progress percentage over time
var newValue = Lerp (startValue, targetvalue, percentage);
percentage= (Time.time - startTime) / duration;


## closed as unclear what you're asking by BlueRaja - Danny Pflughoeft, Josh♦Feb 8 '14 at 20:07

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

If you do have a fixed distance to cover and a fixed speed then you can easily calculate the time to LERP over. Remember the units of speed are units of distance over units of time. Assuming your fundamental units agree (e.g. not mixing miles-per-hour with meters and seconds) then you can get the time to LERP over with a teensy bit of algebra, giving you time=distance/speed.