Animation Blueprint: GetRelevantTimeRemaining() not working properly on 2 states

Hi,
I’ve run into an issue with a 2 state Anim State Machine.

The first state has nothing in it, and an immediate transition to the second state.
The second state has a switch on Enum blend node that selects an animation and plays it.
It has an OnExit event that swaps the enum Value to the value it isn’t.
The transition from the second state to the first state simply has a
GetRelevantTimeRemainingRatio < .1 transition.

Expected results:
The animation switches between anim 1 and anim 2 playing each until >90% of the anim has been played.

Actual Results:
The first animation plays, and transitions to the second animation, which plays, at which point the character freezes.

Cause:
Stepping through the code, the code for GetRelevantAnimTimeRemainingRatio calls:
GetRelevantAssetPlayerFromState() which iterates through the AnimNodes for each anim in the enum. It then calls
GetCachedBlendWeight() which returns 1.0 for both anims. Since Anim2 comes after Anim1 in the loop, it is not selected, and the incorrect animation is being checked for this function.
Thus, the GetRelevantAnimTimeRemainingRatio() function is checking Anim1 while Anim2 is playing (and anim 1 is always at 0% played in this case) so the transition is never taken.

Workaround:
I have implemented a crappy workaround which involves putting AnimFinished Notifies in every anim, and then triggering the animation transition off of a bool from those instead of off of The Relevant time.

I can work at providing a sample project if this is insufficient information, just please let me know!

Thanks in advance!

Hi MarcFletcher,

It would be helpful if you could isolate a sample AnimBlueprint and corresponding animations then migrate them into a blank, but functional level -meaning you have input controls set up in Project preferences and Character blueprint.

If you do not want to post your assets here, you can send me a link to your project download in a private message on our .

Thanks,

.

Hey ,

Here’s a sample project I made in 4.10.4. I set up two versions of the model the first with the Anim Blueprint that is broken, and the second with my workaround. Red = broken, Green = workaround.

(As an aside, the “Left State Event” is getting called twice in here as well, which I have a workaround in for. It’s commented in the Event Graph.)

If you need anything else, let me know!

link text

Thanks for sending the test files. I was able to reproduce this in UE4.10. However it appears fixed in UE4.11preview8. Please test with this latest preview and let me know if it is not functioning as expected for you.