Issues occurring when UMG Animation is destroyed while play

Hello,

When a widget with an existing UMG animation applied to it is destroyed during animation playback and then restored to the slate, the animation pauses at the point where it was destroyed.

In my opinion, the preferred solution for this issue would be to resume playback from the paused state, or to provide a way to determine the cause of the animation termination via the animation delegate when it is destroyed.

Alternatively, if this issue is already a known bug, I would appreciate it if you could provide a list of change logs (changelist) or Git links where it has been fixed or improved.

<br/>

Thank you for your interest in this matter.

[Attachment Removed]

Hi there,

I’m trying to look into this issue however I’m having some trouble when attempting to reproduce it.

Could you please provide some reproduction steps or a minimal repro project so that I can continue the investigation.

Thanks!

- Louis

[Attachment Removed]

Thank you for your interest in my issue.

I have attached a sample project.

The steps to reproduce this issue are as follows:

1. Click Play in the TEST umap.

2. Click the “Play Animation” button. (This animation changes color from Red to Blue.)

3. Press the “Destroy” button while the color is changing.

4. Press the “Construct” button.

5. You will see that the color remains frozen at the point when Destroy was pressed, and no further animation occurs.

What I want is for the animation to either resume from where it stopped or restart from the beginning. Having both options available would be the best solution.

Thank you for your confirmation.

Thanks!

[Attachment Removed]

Hi again,

Thank you very mcuh for providing the repro project & steps. It helped greatly in understanding the situation.

I would like to clarify something in your repro project. The widget playing hte animation is never destroyed, just removed from the parent & then re-added when the construct button is pressed.

What is happening when the widget is removed from the parent it’s SWidget & SWidgetObject are destroyed. Causing MyUMGWidget.IsConstructed() to evaluate to false.

In UUMGSequenceTickManager when ticking the animations if the widget’s IsConstructed() evaluates to false it will tear down the animation, invalidate the widget’s pointer to the tick manager & then remove it’s own reference to the widget.

Essentially any handle to the instance of the animation is lost and the widget cannot start the animation from where it left off once it is reconstructed and added to the parent.

However there is a situation that has the behaviour you desire. If the widget remains constructed and instead the widget stops ticking (e.g because it’s visibility is set to hidden) the animation is not destroyed and will continue to animate as normal once it the widget begins ticking again. If this is appropriate for your situation I would reccommend this.

If you do need to remove the widget from it’s parent tempoarily I would instead suggest storing the current time of the animation before removing the widget. Once the widget is added to a parent again you can play the animation using the stored time as the value for “Start at Time” in the Play Animation node.

As for resetting the animation you could make use of the RestoreState pin on the Play Animation node if you know before the animation plays which option you need. Otherwise you might need to “Play” the animation at 0 Playback speed then stop (pictured below). This is a bit of a hacky workaround but it’s fairly straightforward compared to recreating how the sequencer caches and restores the sate of the widget with RestoreState.

[Image Removed]

Cheers,

- Louis

[Attachment Removed]