Mecanim Animation curves not working as expected

Hi.

I have an animation with a curve applied to it that goes from 0 at the beginning to 1 at the end of the animation. But for some reason when the value in code gets to around 0.7 it will start counting back down to 0.

I noticed that it seems to be the point at which the animation starts transitioning to the next animation that causes it to count back down. But I also had this problem when I created a curve on a lopping idle animation that had no transition, again at 0.7 too.

Is their any way to stop the value of the animation curve from being influenced by a transition or whatever else is interfering?

Any help would be greatly appreciated.

Hey Nytrus,

Just as you predicted, during a transition the curve’s value will ‘blend’ with whatever the curve’s value is on the animation you’re transitioning into. If there is no identical curve on the animation you’re transitioning into then the curve’s value will blend with that curve’s default value - which is usually 0.

In the case of the looping idle animation, the curve only reaches 0.7 before it starts to transition onto itself a.k.a. the beginning of the idle animation that has a curve value of 0.0…so those two values (0.7 0.0) will begin to blend/average and will never make it to 1.0 unless there’s no transition at all.

I’ve encountered the same problem too and as far as I know there’s no way to disable the curve blending…which, as you probably know, can be extremely frustrating!

Thanks for replying, JOHNMCLAY.

I agree that it is frustrating. I’m not sure why Unity chose this as the default functionality and not give an option to disable curve blending as I think there are a lot of cases in which you would want need the unaffected values of the curves.

For example I’m using two curves for an animation to calculate the characters x and y value as they climb up a ledge. But as they reach the top they are dragged back down because of the values dropping to 0.

I guess I will have to come up with an alternative way of moving the character.

I’m fairly new to scripting myself, but can’t you check to see if it’s no longer in transition from one state to another and then perform then use the curves? I’ve have a problem similar to this, but I think it’s more so because i’m using update() instead of fixedUpdate().