AGameModeBase::ShouldReset
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: UFUNCTIONBlueprintNativeEvent
Description
Called by `ResetLevel()` for each actor to determine whether `Reset()` should be invoked on it. The default implementation returns true for all actors.
Caveats & Gotchas
- • The `GameMode` and `Controller` actors are already excluded before this function is called — you do not need to filter them out manually.
- • Since this is a `BlueprintNativeEvent`, the C++ override must be named `ShouldReset_Implementation`; calling `Super::ShouldReset_Implementation(ActorToReset)` is recommended to preserve default behaviour for actors you don't explicitly handle.
- • Returning false here does not call any alternative reset — the actor is simply skipped entirely, so you must reset it yourself if needed.
Signature
ENGINE_API bool ShouldReset(AActor* ActorToReset) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ActorToReset | AActor* | The actor being evaluated for reset. | — |
Return Type
bool Example
Preserve certain actors across a level reset C++
bool AMyGameMode::ShouldReset_Implementation(AActor* ActorToReset)
{
// Keep collectibles in their current state (already picked up)
if (ActorToReset->ActorHasTag(TEXT("Collectible")))
{
return false;
}
return Super::ShouldReset_Implementation(ActorToReset);
} See Also
Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?