RealDocs

UActorComponent::PostMigrate

function Engine Since 5.4
#include "Components/ActorComponent.h"
Access: public Specifiers: virtualoverride

Description

Called after this component has been migrated to a new outer or context via the remote object handle system. Override to fix up internal state that references the old location.

Caveats & Gotchas

  • This override is only compiled when `UE_WITH_REMOTE_OBJECT_HANDLE` is defined — it is absent in standard engine builds without the experimental remote object subsystem enabled.
  • The base implementation updates the owning actor's component lists. Always call `Super::PostMigrate` or the actor's component bookkeeping will be left inconsistent.

Signature

ENGINE_API virtual void PostMigrate(const struct FUObjectMigrationContext& MigrationContext) override;

Parameters

Name Type Description Default
MigrationContext const struct FUObjectMigrationContext& Context describing the migration operation, including source and destination.

Return Type

void

Example

Override to refresh cached owner reference after migration C++
#if UE_WITH_REMOTE_OBJECT_HANDLE
void UMyComponent::PostMigrate(const FUObjectMigrationContext& MigrationContext)
{
    Super::PostMigrate(MigrationContext);
    // Refresh any cached references that may have changed
    CachedOwnerRef = GetOwner();
}
#endif

Version History

Introduced in: 5.4

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.