How to Play Audio with UMG Animation When Game is Paused in Unreal Engine 5?

Hi everyone,

I’m working on a UI animation in Unreal Engine 5 that includes several transform keyframes and audio clips. The animation plays perfectly when the game is running. However, when the game is paused, the animation continues to play, but the audio does not.

I’ve tried using the Play Sound 2D node and checked the IsUISound flag, which works for playing sounds directly, but my situation involves specific keyframes in the UMG animation timeline triggering the sounds. Here are the key points:

  1. UMG Animation with Keyframes: The animation has 3 different sounds that play at 6 different points during the animation.
  2. Audio During Pause: The sounds need to play correctly even when the game is paused.

I understand that audio typically doesn’t play during a pause state, but I need a way to ensure the sounds tied to the UMG animation keyframes still play when the game is paused.

Has anyone faced a similar issue or have any suggestions on how to achieve this? Any help or workarounds would be greatly appreciated!

Thanks in advance!

I’ve found a temporary workaround, while not the most elegant, achieves the desired effect.

  1. Create Event Triggers: In the UMG animation timeline, create 6 event triggers corresponding to the points where the sounds should play.

  1. Custom Events: Define 3 custom events within the UMG Blueprint. These events will handle playing the specific audio clips.

Within each custom event, use the Play Sound 2D node with the IsUISound flag checked. This will play the sound as a UI sound, which continues to play even when the game is paused.

  1. Sequence Events: In the Sequence Events of the UMG animation, bind the 6 event triggers to the respective custom events. This ensures that when the animation reaches these points, the correct custom event is triggered.