Description

When an actor contains a nested component (components declared inside another component class), the hierarchy for the actor blueprint does not match the hierarchy of a placed instance of the actor

Steps to Reproduce
  1. Open UE4 Editor
  2. Create 3 classes (1 Actor - Charlie & 2 Scene Component - Alpha & Bravo)
  3. Add the following to Alpha
    • .h
      UPROPERTY()
      UStaticMeshComponent* Fill;
      
      UPROPERTY()
      	UStaticMeshComponent* Stroke;
      
    • .cpp
      	Fill = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Fill"));
      	Fill->SetupAttachment(this);
      
      	Stroke = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Stroke"));
      	Stroke->SetupAttachment(this);
      
  4. Add the following to Bravo
    • .h - #include "Alpha.h"
      UPROPERTY()
      UAlpha* AlphaA;
      
      UPROPERTY()
      UAlpha* AlphaB;
      
    • .cpp
      AlphaA = CreateDefaultSubobject<UAlpha>(TEXT("AlphaA"));
      AlphaA->SetupAttachment(this);
      
      AlphaB = CreateDefaultSubobject<UAlpha>(TEXT("AlphaB"));
      AlphaB->SetupAttachment(this);
      
  5. Add the following to Charlie
    • .h - #include "Bravo.h"
      UPROPERTY()
      UBravo* Bravo;
      
    • .cpp
      Bravo = CreateDefaultSubobject<UBravo>(TEXT("Bravo"));
      Bravo->SetupAttachment(RootComponent);
      
  6. Compile
  7. Create a blueprint based on Charlie (CharlieBP)
  8. Place instance of CharlieBP into the level

Result:
BP hierarchy lists Root->Bravo->AlphaA->Fill/Stroke->AlphaB->Fill/Stroke
Instance hierarchy lists Root->Bravo->AlphaA->Fill/Stroke->Fill/Stroke->AlphaB

Expected:
BP and Instance have matching component hierarchy

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

2
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.17.24.18.1
CreatedNov 22, 2017
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue