AActor::PostSaveFromRoot
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtual
Description
Called on non-root actors after the package containing the root actor has finished saving. Use to restore state that was modified in PreSaveFromRoot.
Caveats & Gotchas
- • Symmetric with PreSaveFromRoot — any state cleared or altered there must be restored here to avoid leaving the actor in a degraded state after save.
- • Always call Super::PostSaveFromRoot() first; the base implementation may undo streaming-level coordinate transformations applied during the save pass.
- • The save context indicates whether the save succeeded; check ObjectSaveContext before performing post-save actions that only make sense on a successful write.
Signature
ENGINE_API virtual void PostSaveFromRoot(FObjectPostSaveRootContext ObjectSaveContext); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ObjectSaveContext | FObjectPostSaveRootContext | Context for the completed save, including success/failure and cook information. | — |
Return Type
void Example
Restore transient cache after package save C++
void AMyChildActor::PostSaveFromRoot(FObjectPostSaveRootContext ObjectSaveContext)
{
Super::PostSaveFromRoot(ObjectSaveContext);
// Re-initialize the runtime cache that was flushed in PreSaveFromRoot
RebuildRuntimeCache();
} Version History
Introduced in: 5.1
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?