AActor::IsActorBeginningPlay
#include "GameFramework/Actor.h"
Access: public
Specifiers: inline
Description
Returns true while this actor is in the middle of its BeginPlay dispatch — after DispatchBeginPlay() has started but before it completes. Use this to guard logic that must not run during initialization.
Caveats & Gotchas
- • This returns true only during the window between DispatchBeginPlay() starting and finishing. It will be false both before BeginPlay is ever called and after BeginPlay has fully completed.
- • IsActorBeginningPlay() and HasActorBegunPlay() are mutually exclusive: exactly one is true after the actor initializes, never both simultaneously.
Signature
bool IsActorBeginningPlay() const { return ActorHasBegunPlay == EActorBeginPlayState::BeginningPlay; } Return Type
bool Example
Guard against re-entrant initialization C++
void AMyActor::SomeCallback()
{
if (IsActorBeginningPlay())
{
// Called during BeginPlay dispatch — defer or skip
return;
}
// Safe to proceed
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?