Changing component hierarchy of an Actor in c++ needs restart to update

I am on 4.11.1-2934540

How to reproduce:

  • Create a c++ class inheriting from actor.
  • Create 3 scene components and attach them to root:

/* AMyActor.h */

USceneComponent* comp1;

USceneComponent* comp2;

USceneComponent* comp3;

/* AMyActor::AMyActor() */

comp1 = CreateDefaultSubobject(TEXT("Comp1"));

comp2 = CreateDefaultSubobject(TEXT("Comp2"));

comp3 = CreateDefaultSubobject(TEXT("Comp3"));

comp1->AttachTo(RootComponent);

comp2->AttachTo(RootComponent);

comp3->AttachTo(RootComponent);

  • Place AMyActor in the level
  • Hit Compile (Editor). Right now everything looks good.
  • Change comp3->AttachTo(RootComponent) to comp3->AttachTo(comp2).
  • Hit compile from the editor. Hierarchy in the placed actor hasn’t changed.
  • Place a new AMyActor in the scene, the new actor has the updated hierarchy or restart editor and the originally placed actor has the correct hierarchy.

Is this a bug or a known limitation of Hot Reload?

Hello hurt720,

We’ve had a few reports of issues with existing instances of classes not being updated via Hot Reload when changes are made to the construction script. I’ve reported one of those with the bug number UE-26273. This particular one was for values being changed in the constructor in the same manner of how you’re changing the hierarchy so I’ll be avoiding putting in a new report and will add the information about your report to the existing one. Once some changes are made or if the bug is updated/fixed, I’ll be sure to let you know.

Note: While this is currently reported as a bug, we’re not completely sure if this is a limitation of Hot Reload yet and it may be deemed as such in the end.

Thanks for the quick response! Thankfully, everything else on my constructor (including values) updates correctly, so restarting the editor when adding components is not that much of a hassle anyways.