AActor::PostLoadSubobjects
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualoverride
Description
Called after all subobjects have been serialized and their references fixedup during asset load. AActor overrides this to re-register components that were incorrectly left unregistered by older serialization paths.
Caveats & Gotchas
- • This is a serialization callback, not a gameplay callback — the actor may not have a valid world context when it fires. Do not access gameplay systems or other actors here.
- • Overriding without calling Super::PostLoadSubobjects() will skip the engine's component registration fix-up, which can produce components that appear in the actor's subobject list but are never ticked or rendered.
Signature
ENGINE_API virtual void PostLoadSubobjects( FObjectInstancingGraph* OuterInstanceGraph ) override; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OuterInstanceGraph | FObjectInstancingGraph* | The instancing graph used to remap subobject references during load. | — |
Return Type
void Example
Run custom post-load fixup on subobjects C++
void AMyActor::PostLoadSubobjects(FObjectInstancingGraph* OuterInstanceGraph)
{
Super::PostLoadSubobjects(OuterInstanceGraph);
// Fixup stale references introduced by old serialization
if (!IsValid(LegacyComponentRef))
{
LegacyComponentRef = FindComponentByClass<UMyComponent>();
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?