Animation montage's Rate Scale is not working properly with root motion

We are currently prototyping animations in a combat system. We would like our designer to tweak the animation speed with the need of reexporting the animation from the source data.

1) We have tried setting the “Rate Scale” to 1.5 in animation montage window. This work at the first glance. The character previews the animation faster. But if the is a root motion, the character slides on the floor. It seems that the timing for the montage and the timing for the root motion is somehow inconsistent.

2) Later on I was experimenting with setting a higher “Rate Scale” in the animation sequence setting. Note that I have reverted the animation montage’s setting. In this scenario the character moves faster, and the root motion is working as expected. But there is another issue, that after the animation is played, the character is stuck in the last frame of the animation for a few seconds.

Note that we are usually experimenting with MontageTimeStretchCurve, but it was not used in this case.

Is there some other settings I might try? Is there a way to fix it on our side? or is it an engine bug?

We are currently using version from changelist 1083985

Steps to Reproduce

1st scenario:

  • Pick an animation with root motion
  • Go to animation montage window
  • Set “Rate scale” to 1.5
  • Observe sliding legs when playing in game (PIE)

2nd scenario:

  • Pick an animation with root motion
  • Go to animation sequence window
  • Set “Rate scale” to 1.5
  • In PIE: observe character is stuck after the animation is finished

Hi, when changing the play rate of the animation/montage, the distance covered by the root motion of the animation should remain the same but the amount of time that the mesh takes to cover that distance should change accordingly based on the play rate (ie. if you set the play rate to 2x, the mesh should reach the destination point in 1/2 the time).

For the first scenario that you described, I see the expected behaviour that I mentioned. I’ve attached a video to check whether that’s what you’re seeing - if it’s not, is there something different with your setup?

For the second scenario, we do have a bug in the engine. It seems that when the play rate is changed on the animation that the montage references, the montage timing information isn’t updated correctly. If you close and reopen the montage in the montage editor, the timing information should be regenerated (via FAnimModel_AnimMontage::RecalculateSequenceLength). If you then PIE after reopening the montage, you should see the correct behaviour (ie. no hang after the animation has finished).

The bug is caused by the timing information not being updated. So, for instance, if you have a 4 second animation that you change the play rate to be 2x for (so it’s now effectively a 2 second animation), the animation plays out in 2 seconds but the montage continues to play for the 4 seconds.

I’m looking at making a fix for this. I think we need to move the code from FAnimModel_AnimMontage::RecalculateSequenceLength into UAnimMontage and have that update automatically when a referenced animation is updated.

However, I’m not sure that any of this will solve your original problem?

Quick update on this, we have a potential fix for the issue where the playrate change on an anim sequence, that’s referenced by a montage, wasn’t updating the montage correctly. It’s shelved at 49001806 if you want to try integrating it.