AActor::HasActorBegunPlay
#include "GameFramework/Actor.h"
Access: public
Specifiers: inline
Description
Returns true once BeginPlay has fully completed on this actor and EndPlay has not yet been called. The standard runtime 'alive and initialized' check.
Caveats & Gotchas
- • Returns false during the BeginPlay dispatch itself — use IsActorBeginningPlay() if you need to detect that window.
- • Actors spawned at runtime may briefly exist with HasActorBegunPlay() == false immediately after spawning if BeginPlay hasn't run yet, which can happen in the same frame before the deferred begin-play pass.
Signature
bool HasActorBegunPlay() const { return ActorHasBegunPlay == EActorBeginPlayState::HasBegunPlay; } Return Type
bool Example
Check before accessing gameplay-dependent state C++
void AMyActor::OnSomeEvent()
{
if (!HasActorBegunPlay())
{
// Actor not yet fully initialized; skip
return;
}
DoGameplayLogic();
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?