AGameModeBase::ClearPause
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: virtualENGINE_API
Description
Iterates the list of CanUnpause delegates and removes any that return true. When the list is empty the game is unpaused. Returns true if unpausing occurred.
Caveats & Gotchas
- • This function evaluates delegates but does not force-clear them. If a delegate returns false, it stays in the list and the game remains paused. Use ForceClearUnpauseDelegates to unconditionally remove a specific actor's delegates.
- • Called automatically by the engine each tick while paused. You rarely need to call it manually; the typical approach is to ensure your CanUnpause delegate returns true at the right time.
Signature
virtual bool ClearPause() Return Type
bool Example
Check if pause cleared after a menu closes C++
void AMyPlayerController::CloseMenu()
{
bMenuOpen = false; // delegate's IsMenuClosed() will now return true
// ClearPause is called automatically by the engine on the next tick
// but we can also trigger it immediately:
AMyGameMode* GM = GetWorld()->GetAuthGameMode<AMyGameMode>();
if (GM) { GM->ClearPause(); }
} Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?