Animation Curve evaluate beyond maximum

Hi,

I’ve added a ‘custom curve’ ease function to iTween which accepts an Animation Curve which can be drawn inside the inspector. It seems to be working however the effect I am trying to achieve is similar to games like Bejeweled where an object falls down to just beyond a specified position, and then smoothly moves back again to rest in the specified position. I’m aware there are ease functions such as elastic and bounce but these are too strong for the effect I am after. The issue I have is even if I draw the curve extending beyond 1 in the y axis to try and get the object to ‘overshoot’ the intended target position, it never does - it just follows the curve but ignores the section of curve I have going over the maximum value. I can get it to achieve the effect I want by having the finishing point on 0.9 and the overshoot on 1 but the object doesn’t tween to intended target position.

Here’s my custom ease function follow a Animation curve:

private float custom(float start, float end, float value)
{
	return Mathf.Lerp(start, end, Curve.Evaluate(value));
}

And my curve looks like this (you can see the bit at the end where it overshoots and then rests).

Many Thanks,
Adam

[10573-screen+shot+2013-04-30+at+16.07.25.png|10573]

You can’t use Lerp because that is clamped 0 to 1 so you need:

  return start + ((end - start) * Curve.Evaluate(value));

Since 2017.1 Mathf.LerpUnclamped can be used instead. It won’t clamp t and linearly extrapolate whenever t is outside the range [0, 1].