RealDocs

AGameModeBase::HasMatchEnded

function Engine Blueprint Since 4.14
#include "GameFramework/GameModeBase.h"
Access: public Specifiers: virtualENGINE_APIUFUNCTIONBlueprintCallableconst

Description

Returns true if the match can be considered over. In AGameModeBase this always returns false; AGameMode overrides it to check for the WaitingPostMatch state.

Caveats & Gotchas

  • In AGameModeBase the base implementation returns false unconditionally. If you are not using AGameMode's match-state machine you must override this to reflect your own end condition.
  • Clients should check AGameStateBase::HasMatchEnded() rather than querying the game mode directly, since GameMode does not exist on clients.

Signature

UFUNCTION(BlueprintCallable, Category=Game)
virtual bool HasMatchEnded() const

Return Type

bool

Examples

Poll for match end on Tick and print a message when over Blueprint
Event Tick Delta Seconds Delta Seconds Has Match Ended Target is Game Mode Base Target Return Value Branch Condition Condition True False Print String In String Match has ended! Match has ended!
Edit Blueprint graph Poll for match end on Tick and print a message when over
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Override for a custom end condition C++
bool AMyGameMode::HasMatchEnded() const
{
    return bWinnerDetermined || Super::HasMatchEnded();
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.