Animation Curve to Float variable? help!

Hello, I’m trying to make a float variable follow a specific pattern, and the animation curve serves me a lot, but I can’t get it to follow this pattern (I’m simulating a gearshift effect with different tones).

Thank you!

//EngineRPM is a float
//ShiftingCurve is a animation curve

EngineRPM = ShiftingCurve;

Is the animation already configured in the pattern you want? To get the value out of an AnimationCurve you need to use ShiftingCurve.Evaluate(t), where t is the x-value you want to get the curve value of.

Exactly !, I put it in loop mode.

But, when the car makes the change (which is when the value must follow the pattern of the curve, simulating a deceleration for clutch or gear change), that same value stays at 1.

The line of code is the same:

 EngineRPM = ShiftingCurve.Evaluate(Time.time);