Playing Montages can break after binding a actor to a Level Sequence

Heres the flow as best I can understand it from debugging this.

1) Players AnimInstance is cached off in FPreAnimatedSkeletalAnimationState.

2) Animation starts playing and because bForceCustomMode is true we call SetAnimationMode on the captured SkelMeshComponent. (MovieSceneSkeletalAnimationSystem.cpp - line 777)

3) Since we are changing AnimModes this causes the previous AnimInstance to be cleared and uninitialized. Note that this is the same AnimInstance that has been cached off by the Sequencer.

(SkeletalMeshComponent - line 3722)

4) The Sequencer finishes and restores the cached AnimInstance. This AnimInstance though has been Uninitiaized and is unusable in its current state.

5) Later when attempting to a montage using this AnimInstance you are blocked by the new bEarlyOutMontageWhenUninitialized.

The flow makes sense in the 2 areas, but it does seem like doing a deep copy into FPreAnimatedSkeletalAnimationState (instead of just grabbing the pointer) might be more correct overall.

Also not entirely a blocking issue for us since theres really no reason for us to use Force Custom Mode on the Animation Track to begin with. Just a subtle bug that had pretty obvious reprocussions (i.e. I opened a door and can no longer do any attacks).

Steps to Reproduce
1) Launch PIE

2) Hit Spacebar (This will a badly made Ability that animates into a T-pose)

3) Hit G (this will play a badly made Sequencer that binds the player into a Animation track where they run)

4) Hit Spacebar again. Note that the Character no longer animates and you have something like this in your log: LogAbilitySystem: Warning: UAbilityTask_PlayMontageAndWait called in Ability GA_Test2_C_0 failed to play montage MM_T_Pose_Montage_Test; Task Instance Name None.

Hi [mention removed],

Thanks for reporting the issue.

I’ve been able to reproduce the behavior you described, and I can confirm that it still occurs in the latest Unreal Engine development branch. I’ve submitted a report to Epic’s development team, and I’ll follow up here once I receive a public bug tracker link.

Once the bug tracker entry is live, you’ll be able to view a full description of the issue, monitor its status, and access the related fix commit once it becomes available.

Best Regards,

Joan

Thanks!

Public bug tracker: Unreal Engine Issues and Bug Tracker (UE\-290889)