IsEditorOnly is not reflected in grandchild actor when parent/child/grandchild are constructed with ChildActorComponent. This causes the issue that actor will increase incorrect when save the level.



Change the following code in ChildActorComponent.cpp.

void UChildActorComponent::CreateChildActor()
    // ...
#if 1 // changed start
    bool isEditorOnly = IsEditorOnly();
    if (MyOwner)
        isEditorOnly = isEditorOnly || (MyOwner->IsEditorOnly() || MyOwner->HasAllFlags(RF_Transient));
    if(HasAllFlags(RF_Transient) || isEditorOnly)
#else // original
    if (HasAllFlags(RF_Transient) || IsEditorOnly())
#endif // changed end
        // If we are either transient or editor only, set our created actor to transient. We can't programatically set editor only on an actor so this is the best option
        Params.ObjectFlags |= RF_Transient;
    // ...
Steps to Reproduce
  1. Open attached sample project.
  2. Open the [TestMap] level. 
  3. Save the  [TestMap] level.
  4. Reopen the [TestMap] level.

          When see the World Outliner, the Actor (BP_GrandChild) has increased on the level.



Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-85478 in the post.

Login to Vote

ComponentGameplay - Components
Affects Versions4.224.234.24
CreatedDec 6, 2019
UpdatedDec 12, 2019