UMG Pause

I am using the set game paused state to true but I am unable to see my UI. I saw that there is a tickable while paused node, but how do I get that to work with widgets?

Widgets are unaffected by the game pause, only Actors in the world are affected by it. Widget Blueprints are Slate widgets under the hood and so they continue to Tick as long as they are visible.

I figured it out. When I created the widget prior and have it check for conditions to show certain aspects, the tick would not run after pausing. I had to add the widget after the pause and not before. Now it displays correctly.

In fact they ARE affected. if you dynamically create a widget component you HAVE to reference it and set a “Set Tickable when Paused” to true… for future seekers of wisdom ^^

Edit: widget component = actor part = Nick was right in the wrong spot ^^

ty ty ty ty ty :smiley:

I do not understand how to set widgets to tick when paused. I do not have a option for “Set Tickable when Paused. So, how do you set dynamically generated widgets to tick when game is paused?

1 Like

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