move with animationcurve speed

hi all
i want move an object between two point in terrain with speed depending on animationcurve .
any one has any idea?
thankful.

animation curves are 2d… there’s an input and an output. What part of it is ‘speed’, and what is the other part?

y is speed.
we have two point on terrain and want to move from one point to another with speed of animation curve.

ok… and what is the input to get the speed?

There is not enough information to answer your question.

I’m betting the ‘input’ to get your speed will BE the answer to your question.

input is animationcurve.
input for speed is animationcurve.

You can use the Evaluate function to do that: http://docs.unity3d.com/Documentation/ScriptReference/AnimationCurve.Evaluate.html. I usually make a 1 second long animation curve then divide my current value by the total value, or in your case current distance by the total distance, to get a percent and use Evaluate to get the place on the curve. You can then multiply the return by a speed value to get your speed.

lol

an animation curve has in input and an output. The curve can’t be the input, the curve is the result of the relationship.

Usually the input is ‘time’ and the output is some scalar.

… you obviously don’t understand what a curve is.

You remember Algebra class, and you learned about functions:

f(x) = yx + b
f(x) = x^2

you have an input of ‘x’, and it outputs some y value, and you map all values of x to draw the curve. That’s what an animation curve is.

that output is your speed… but what the hell is that speed dependent on!?

time
location
mass
my level of patience
height

1 Like

input is time.

1 Like