RealDocs

AActor::PreDuplicateFromRoot

function Engine Since 5.6
#include "GameFramework/Actor.h"
Access: public Specifiers: virtual

Description

Called on the source actor before it and its sub-objects are duplicated (e.g. during PIE world creation or actor copy). Override to adjust duplication parameters or prepare the actor for cloning.

Caveats & Gotchas

  • Introduced in UE 5.6 as a replacement for the deprecated FDuplicationSeedInterface — code using the old interface should migrate to this override.
  • Modifying DupParams inside this callback affects all objects duplicated in the same pass, not just this actor; be careful when altering shared settings.
  • The base implementation is a no-op; calling Super::PreDuplicateFromRoot() is harmless but not strictly required.

Signature

virtual void PreDuplicateFromRoot(FObjectDuplicationParameters& DupParams) {}

Parameters

Name Type Description Default
DupParams FObjectDuplicationParameters& Duplication parameters that can be inspected or modified before the duplication proceeds.

Return Type

void

Example

Override to set a custom duplication flag C++
void AMyActor::PreDuplicateFromRoot(FObjectDuplicationParameters& DupParams)
{
	Super::PreDuplicateFromRoot(DupParams);
	// Add a flag so duplicated objects know they were cloned by this actor
	DupParams.FlagMask |= RF_Transient;
}

Version History

Introduced in: 5.6

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.