Event Execution Order
Complete reference for the order in which Unreal Engine calls lifecycle events, tick functions, and callbacks. Understanding this order is critical for avoiding init-order bugs, race conditions, and the classic "why is this pointer null in BeginPlay" problem.
1. Actor Lifecycle (The Big Picture)
Every AActor goes through a fixed sequence from construction to garbage collection.
Components follow a parallel but interleaved order. The diagram below shows the full path
for a spawned actor (via SpawnActor).
Level-placed actors follow a similar path but use PostLoad instead of PostActorCreated.
2. Construction & Initialization
GetWorld(), spawn actors, or set timers here.
Use BeginPlay() for gameplay init.
What belongs where
| Event | Use for | Safe to access |
|---|---|---|
| Constructor | CreateDefaultSubobject, set defaults, StructureScriptConfig | CDO properties only. No world, no other actors. |
| PostInitProperties | Adjust properties after serialization | UProperties initialized. No components registered yet. |
| PostActorCreated | One-time setup after spawn (not level load) | Actor exists in world, but components may not be initialized. |
| OnConstruction | Data-driven setup, procedural generation | Transform is set. Runs in editor too — keep idempotent. |
| PostInitializeComponents | Cross-component wiring, caching references | All components registered and initialized. |
| BeginPlay | Gameplay init, timers, bindings, finding other actors | Everything. World is fully set up. |
Spawned vs Level-Placed Actors
- Constructor
- PostInitProperties
- PostActorCreated
- OnConstruction
- Components register
- PostInitializeComponents
- BeginPlay
- Constructor
- PostInitProperties
- PostLoad
- OnConstruction (editor only)
- Components register
- PostInitializeComponents
- BeginPlay
OnConstruction does not run again at runtime
for actors already placed in a level — it already ran in the editor when the level was saved.
Only PostLoad and onwards run at runtime.
3. BeginPlay
BeginPlay is the most commonly overridden lifecycle event. It fires
when gameplay starts (or when an actor is spawned during gameplay). The call order is:
PostInitializeComponents for the earliest reliable cross-actor wiring,
or defer with a timer / delegate.
When does BeginPlay fire?
- Level load: After all actors in the level have run through construction and registration
- Runtime spawn: Immediately after PostInitializeComponents (same frame as SpawnActor call)
- Streaming sub-levels: When the sub-level becomes visible, actors in it get BeginPlay
- PIE (Play In Editor): Fires on editor-to-PIE transition for all level-placed actors
4. Per-Frame Tick Order
Each frame, the engine runs through a fixed sequence of phases. Tick functions fire within specific tick groups that determine their position relative to physics.
5. Tick Groups
Every tickable actor and component belongs to a tick group set via PrimaryActorTick.TickGroup
or PrimaryComponentTick.TickGroup. The group controls when the tick fires relative to physics.
| Tick Group | When | Best for |
|---|---|---|
| TG_PrePhysics | Before physics simulation | Most gameplay: movement input, AI decisions, ability activation. This is the default. |
| TG_DuringPhysics | Parallel with physics | Work that doesn't read or write physics state. Rarely used. |
| TG_PostPhysics | After physics, before animation | Responding to collision results, adjusting positions after physics. |
| TG_PostUpdateWork | After animation evaluation | Camera adjustments, IK fixups, anything that needs final bone transforms. |
Setting tick groups in C++
// In constructor
PrimaryActorTick.TickGroup = TG_PostPhysics;
// For a component
PrimaryComponentTick.TickGroup = TG_PostUpdateWork;
// Tick dependencies — ensure ActorB ticks after ActorA
ActorB->PrimaryActorTick.AddPrerequisite(ActorA, ActorA->PrimaryActorTick); AddPrerequisite to guarantee one actor ticks before another, without
moving them to different groups.
6. Timers & Latent Actions
Timers and latent actions run after all tick groups have completed, but still within the same frame.
| Mechanism | Fires when | Notes |
|---|---|---|
| SetTimer | After all tick groups, in timer manager update | Executes on the game thread. Cleared on EndPlay. |
| SetTimerForNextTick | Timer update of the next frame | Useful for deferring work by one frame. |
| Delay (Blueprint) | Latent action update, after timers | Blueprint Delay node uses the latent action system. |
| AI MoveTo / latent tasks | Latent action update | Behavior Tree tasks and AI latent moves update here. |
7. Input Processing
Input is processed early in the frame, before any tick groups run.
8. Physics, Overlaps & Hits
Physics simulation runs between TG_PrePhysics and TG_PostPhysics. Overlap and hit events fire after physics completes.
UCharacterMovementComponent performs its own sweeps during TG_PrePhysics
(in its tick). Overlap/hit events from movement sweeps fire immediately during that tick,
not after the physics step. This is why you can get overlap events before physics runs.
9. Animation Evaluation
Animation evaluation runs after TG_PostPhysics and before TG_PostUpdateWork.
10. Game Framework Initialization
When a level loads and a game session starts, the game framework objects are created in a specific order. Understanding this is critical for multiplayer and game mode logic.
11. Pawn Possession
When a Controller possesses a Pawn, the following sequence fires:
SetupPlayerInputComponent is called during
Possess, which happens after BeginPlay. If you need input bindings earlier, you're likely
trying to bind too soon. The Pawn must be possessed first.
12. Replication (Multiplayer)
In multiplayer, the server sends replicated properties to clients. Understanding when OnRep
callbacks fire relative to other events is essential.
Server → Client replication order
Client-spawned replicated actors
When a replicated actor arrives on the client, the lifecycle is compressed:
PostInitializeComponents → initial OnRep callbacks →
BeginPlay. Replicated properties set before spawn are
available in BeginPlay on the client (OnRep fires first).
13. EndPlay & Destruction
EndPlay reasons
| EEndPlayReason | Triggered by |
|---|---|
| Destroyed | Explicit DestroyActor() call |
| LevelTransition | Seamless or hard travel to another map |
| EndPlayInEditor | Stopping PIE session |
| RemovedFromWorld | Streaming sub-level unloaded |
| Quit | Application exit |
14. Common Gotchas
"Pointer is null in BeginPlay"
You're referencing another actor that hasn't had its BeginPlay called yet.
Actor BeginPlay order across different actors is not deterministic.
Use PostInitializeComponents for cross-actor references,
or defer the lookup with SetTimerForNextTick.
"Component is null in constructor"
You used FindComponentByClass in the constructor.
Components from Blueprint (added in editor) aren't available until after
PostInitializeComponents. Only components created with
CreateDefaultSubobject in the same constructor are available.
"OnRep fires before BeginPlay on client"
This is by design for initially replicated actors. Properties set on the server before spawn arrive on the client and trigger OnRep before BeginPlay. This lets BeginPlay see the correct initial state. Guard your OnRep functions against uninitialized state.
"Timer callback fires on a destroyed actor"
Timers set with SetTimer on a UObject are automatically cleared
when the object is destroyed. But raw function pointers or lambdas that capture this
can outlive the object. Always use the FTimerDelegate form
and clear timers in EndPlay.
"Overlap events fire during movement, not after physics"
UCharacterMovementComponent performs sweeps during its tick
(TG_PrePhysics). Overlaps from character movement fire immediately, before the physics step.
Overlaps from physics simulation (rigid bodies, projectiles) fire after physics.
Don't assume all overlaps arrive at the same time.
"Construction Script runs twice in editor"
OnConstruction re-runs whenever you move an actor in the editor,
change a property, or recompile the Blueprint. It can run many times. Never put one-time
initialization here — it must be idempotent (safe to run repeatedly with the same result).