AActor::IsPendingKillPending
#include "GameFramework/Actor.h"
Access: public
Specifiers: inlineconst
Description
Returns true if this actor has begun the destruction process or has already been destroyed. Set at the start of UWorld::DestroyActor, before any shutdown logic runs.
Caveats & Gotchas
- • This returns true as soon as DestroyActor() is called, even before EndPlay, component unregistration, or any other cleanup — do not assume the actor is fully cleaned up when this first becomes true.
- • The name is a legacy holdover from the old PendingKill GC flag. The underlying check now combines bActorIsBeingDestroyed with IsValidChecked(), so it catches both in-progress and already-garbage-collected actors.
- • Prefer IsValid(Actor) for general null/validity checks in gameplay code. IsPendingKillPending() is more useful in engine/framework code that needs to distinguish 'being destroyed right now' from 'already gone'.
Signature
inline bool IsPendingKillPending() const Return Type
bool Example
Guard against acting on an actor that is mid-destruction C++
void AMyManager::ProcessActor(AActor* Actor)
{
if (!Actor || Actor->IsPendingKillPending())
{
return; // Skip actors that are being or have been destroyed
}
// Safe to use Actor here
} See Also
Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?