Need a litlle help on a Lerp[RESOLVED]

Hi everyone !

I’m lerping an object A to B, ok that workd, pretty easy indeed.

But I want more specific lerp with movin on axisY in the lerp:

At A my objectY is set at 0, same for B, and I want while lerping object A upping on Yaxis and downing on B like a beatiful curve .

Thanks !

Image ref.
http://postimg.org/image/85sgpthc1/

You can make an Animation curve for the Y and sample it into the position each frame.

Can be a way yes thanks, no other way with scripting ?

Plenty of ways with scripting - in fact, LaneFox’s suggestion does involve scripting, I believe you’ve misinterpreted it. He’s not saying make an animation; he’s suggesting you create a variable of type AnimationCurve, and in the course of your loop, take a sample of the value at a given “time” value. AnimationCurves are useful for far more than just animation.

Check out the AnimationCurve class in the manual for more info.

Ah yes misinterpreted it …
Ok now I see what you mean, but another question, how can I the “given time value” while my lerp ?

Something like:

public AnimationCurve someCurve; //you can edit this is the inspector
void Update() {
Vector3 lerpedPosition = Vector3.Lerp(a, b, someTimeValue);
float heightFromCurve = someCurve.Evaluate(someTimeValue);
transform.position = lerpedPosition + Vector3.up * heightFromCurve;
}

Sorry I don’t get it … I modify my lerp with yours, in “someTimeValue” I set Time.deltaTime*10f, but my object up, and up, and up again to infinity and never down.
My curve it’s like draw it above … I don’t understand.

EDIT;
Get finally a way ! I search for lerps exemple on Goo and discover that my lerps wasn’t good constructed !
Thanks at all, bye !