Set animation curves default value or remove value smoothing

Hi! I’m having a problem with animation curves values.

I’m controlling the speed of some of my animations by setting Animation Curves to them in Import Settings like this:

4491166--413848--upload_2019-5-1_14-47-6.png

It works, but there is a problem. When an animation clip doesn’t have that curve, the value defaults to zero. This causes a problem because, it seems like the value is smoothed.

Right now, the only animation clips I applied curves to, are attack animations. Most (if not all) of them start and end with a value of 1 (or close):

However, because the default value is 0, and because it seems the value doesn’t change instantly (is smoothed), the animation plays like this, if it is played after an animation with no speed curve (notice the difference at the start):

So, to solve this I need to do one of two things:

  1. Tell Unity that the default value of “Curve/Speed” should be 1. (I don’t know how)
  2. Tell Unity to not smooth curves values. Instead, instantly change the values. (I don’t know how)
  3. Add animation curves to ALL of my animations (too time consuming, I got hundreds of them and they can be played in several combinations)

Does somebody have an idea to solve this?

Thanks for reading

I found the solution. Unity takes the starting value of the animator parameter as its default value. I just had to set it to 1.0 and now that is the value Unity gives to it when there is no Curve data

2 Likes

Thank you for posting the solution!
Was gonna ask the very same thing.

2 Likes