Description

Single Frame Blendspace nodes don't correctly sample/generate root motion. The reason for this is because of how we calculate the delta to bump the sampling within the blendspace each frame. In a single frame blendspace FAnimNode_BlendSpacePlayer::PlayRate will always be zero. This means that MoveDelta in UBlendSpaceBase::TickAssetPlayer() will always be zero which results in NormalizedCurrentTime & NormalizedPreviousTime always being the same (ie. FAnimationRuntime::AdvanceTime(Instance.bLooping, MoveDelta, /inout/ CurrentTime, NewAnimLength); does not change the current time).
This means that when we attempt to sample the root motion in:

 Context.RootMotionMovementParams.AccumulateWithBlend(Sample.Animation->ExtractRootMotion(PrevSampleDataTime, DeltaTimePosition, Instance.bLooping), SampleEntry.GetWeight()); 

we don't get any root motion as we've sampled with a zero delta time increment and the current (rather than previous) sample time.
We need another way of generating/storing the current / previous sample times along with the delta time in order to resolve this.

Steps to Reproduce
  1. Select a locomoting animation asset in editor and set it to generate root motion
  2. Create a blendspace that uses that single animation
  3. Create an anim bp
  4. In the class defaults set the Root Motion Mode to Root Motion From Everything
  5. Add the blendspace and convert it to a Single Frame Blendspace
  6. Create an hookup a variable to drive the frame
  7. Setup a character BP to use the anim bp + mesh and add it to a level
  8. Add logic within the character BP to drive the variable on the anim bp
  9. PIE
    1. Note how when the variable changes the frame being played on the blendspace, no root motion is generated (ie. the character doensn't move). Whereas, if you do not convert the blendspace to a single frame blendspace, the root motion will be extracted.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-120375 in the post.

0
Login to Vote

Fixed
ComponentUE - Anim - Runtime
Affects Versions4.26
Target Fix5.0
Fix Commit18283189
Main Commit18283507
Release Commit18283189
CreatedJul 26, 2021
ResolvedNov 24, 2021
UpdatedJan 26, 2023
View Jira Issue