Description

When a native actor 'AMyActorClass' creates AttributeSets as a default subobject via CreateDefaultSubobject, duplicating an actor blueprint based on AMyActorClass will result in a blueprint with an invalid attribute set.

The impact of this is that duplicating actor blueprints with attribute sets results in a broken asset. The attribute set is invalid at editor-time and will not work at runtime. The duplicated blueprint is unusable.

Steps to Reproduce
  • Create a native actor class 'AReproActor' with a default subobject AttributeSet, that is
    • Give the actor class a UPROPERTY of UAttributeSet* MyAttributeSet.
    • In the native constructor, create it with CreateDefaultSubobject
  • Override the actor class's PostInitProperties() to ensure that MyAttributeSet is valid: ensure(IsValid(MyAttributeSet))

 

AAttributeSetReproActor::AAttributeSetReproActor()
{
    PrimaryActorTick.bCanEverTick = false;
    
    AbilitySystemComponent = CreateDefaultSubobject<ULabAbilitySystemComponent>(TEXT("ASC"));
    AbilitySystemComponent->SetIsReplicated(true);
    HealthAttributeSet = CreateDefaultSubobject<ULabHealthAttributeSet>(TEXT("HealthSet"));
}

void AAttributeSetReproActor::PostInitProperties()
{
    Super::PostInitProperties();
    if (ensureAlwaysMsgf(IsValid(HealthAttributeSet), TEXT("Health attribute set on '%s' invalid!"), *GetPathName()))
    {
        UE_LOG(LogTemp, Warning, TEXT("POST INIT - Health attribute set on '%s' is valid: %s"), *GetPathName(), *HealthAttributeSet->GetPathName());
    }
} 

 

  • Create a blueprint BP_ReproActor based of AReproActor and save it.
  • Open the blueprint BP_ReproActor.
  • Observe: ensure(IsValid(MyAttributeSet)) passes in PostInitProperties
  • Duplicate the blueprint, the editor will name it BP_ReproActor1.
  • Open the blueprint BP_ReproActor1.
  • Observe: ensure(IsValid(MyAttributeSet)) fails in PostInitProperties. MyAttributeSet has become invalid in the duplicated blueprint.
  • Expected: MyAttributeSet remains valid on the duplicated blueprint. It should be a valid attribute set subobject that is outered to BP_ReproActor1's CDO.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-273844 in the post.

2
Login to Vote

Unresolved
CreatedApr 22, 2025
UpdatedApr 23, 2025
View Jira Issue