UAnimInstance::GetCurveValue() returns wrong values when transitioning from another state

Hi,

I have an animation curve in my sequence that plays from 1 to 0 in a linear fashion, when I play this animation on a transition from another state I grab the curve value by it’s name with GetCurveValue(FName("DistanceCurve")); and print it’s value on the output log.

Why is it that instead of starting at the initial values (1.0f) the values start at cero and ramp up until they catch up with the actual curve values? Also is there a way to get the actual curve values coming from another state without having this issue?

My initial guess is that the animation is blending coming from another state and that’s why I cannot get the actual values of the curve until the blending is done.

Any help on this would be appreciated.

Found the issue, the problem is indeed a blending issue, you see between animation states there is a standard blending being applied, and if you click on the transition rule you will see these settings, by default there is a 2 second blending happening and this is affecting how much the weight is applied on the incoming animation, that’s why the animation curve doesn’t show the actual values when transitioning.

To get the actual curve value after the trasition I had to set the blendtime to 0sec and check if there is a curve when I request it before using it’s value, like

float DistanceCurveValue = 0.0f;
if (GetCurveValue(FName("DistanceCurve"), DistanceCurveValue))
{
     // do something
}

I hope this can help someone else looking for the same answer.

I myself had a similar yet different issue - but I can only blame myself :slight_smile: I was trying to blend the montage from curve. From a curve within the montage. But for some reason I was using 1 for completely invisible and 0 value for visible. Aaaand since the moment the montage is blent(blended?) out the curve goes to 0 it snapped back to visible. But then the curve value becomes valid again thus 1. So it started dancing like crazy.
At first I didn’t know what the problem was - I did not expect a montage that is actively running to become irrelevant along with its curves if it’s section (the upper body, above pelvis bone in this case) gets a 0 alpha.
After I randomly set the values to 0 and 1 instead of 1 and 0 it became very apparent very fast, even for dumb ol’ me.
Now I’m clamping the curve values between 0.0001 and 1. Because I’m lazy to think of a different approach. But since it works perfectly…