ChildActorComponent: Child Actor blueprint becomes dirty when RootComponent is set in C++

Hi,

I have an Actor (lets call it BadActor) that is defined in C++ where i initialize its RootComponent in the constructor using:

SetRootComponent(CreateDefaultSubobject<USceneComponent>(TEXT("DefaultRootComponent")));

and then derive this Actor in a new blueprint class (called BadActorBP).

In a separate blueprint Actor (TestContainer) I use the BadActorBP in a ChildActorComponent. Every time i open, or compile TestContainer, or modify any of its properties the BadActorBP becomes dirty.

If i don’t create a default root component in C++ the problem doesn’t occur.

I have attached a test case project that demonstrates the problem.
By opening the TestContainer.usasset the BadActorBP.uasset becomes dirty as i mentioned. Any modification of the TestContainer (even unrelated to the ChildActorComponent that instantiates the BadActorBP) will also cause the file to become dirty.

I found a quick fix for the issue so that i can continue development on my project. You can check the fix by setting in BadActor.h:

#define ENABLE_QUICKFIX 1

In effect what this does is not to create a default root component but instead create one either during OnConstruction or in BeginPlay. Obviously this is not ideal since you can’t serialize the root component but as a temporary solution its fine in my case.

Hey hamouras-

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-43517) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers

Hello,

We’ve run into the same problem. We’re on 4.16.2, but it’s been an issue for a while. Based on the bug report link, this should be fixed now, but looking in the licensee P4 depot it appears the fix was overwritten accidentally (I presume). The original fix was in changelist 3372764. Another change in that same chunk of code was submitted with changelist 3431439, but the original fix seemed to be intact. However, with changelist 3439045 Dev-Main was merged into Dev-Framework, erasing the fix from 3372764.

Thanks,
Spitzley
Obsidian Entertainment

Hey -

The report that I entered was a duplicate of an already existing issue (Unreal Engine Issues and Bug Tracker (UE-43328)) that’s targeted for a 4.18 fix.

Hi ,

I talked with Marc Audy on the UDN and he confirmed that the change was backed out in favor of another one (CL#3603249) that didn’t affect some systems that rely on the original behavior. It’s a very simple fix, so I’ll just integrate that one.

Thanks,