UGameplayStatics::DoesSaveGameExist
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: static
Description
Returns true if a save file exists for the given slot name and user index. Use to distinguish a new game from a returning player.
Signature
static ENGINE_API bool DoesSaveGameExist(const FString& SlotName, const int32 UserIndex) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SlotName | const FString& | The slot name to check. | — |
| UserIndex | int32 | Platform user index. | — |
Return Type
bool Caveats & Gotchas
- • Only checks existence — does not validate that the save file is uncorrupted or compatible with the current USaveGame class version.
- • File I/O — avoid calling every frame. Cache the result at startup.
Example
Show continue vs new game options C++
bool bHasSave = UGameplayStatics::DoesSaveGameExist(TEXT("Slot1"), 0);
MainMenuWidget->SetContinueButtonEnabled(bHasSave); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?