Description

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.

 

 Workaround:

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 to Questions & Answers just mention UE-85478 in the post.

0
Login to Vote

Fixed
ComponentUE - Gameplay - Components
Affects Versions4.224.234.24
Target Fix4.26
Fix Commit14105452
CreatedDec 6, 2019
ResolvedAug 28, 2020
UpdatedApr 28, 2021