UMG Pause

To pause the widget animation, you actually need to stop the tick from firing. To do this the only way I know is by creating a base widget class in C++ and overriding the Native tick class to not tick if the Game is Paused.

// MyUserWidget.h
#include "MyUserWidget.generated.h"

UCLASS()
class UMyUserWidget : public UUserWidget
{
    GENERATED_BODY()

public:
    // Override the native tick function
    virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;

    // A boolean variable to control the pause 
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pause")
    bool bGamePaused;
};

// MyUserWidget.cpp
#include "MyUserWidget.h"

void UMyUserWidget::NativeTick(const FGeometry& MyGeometry, float InDeltaTime)
{
    // Check if the Game is not Paused
    if (!bGamePaused)
    {
        // Call the parent implementation
        Super::NativeTick(MyGeometry, InDeltaTime);
    }
}
2 Likes