Child actors created through BP no longer attached to parent actor in World Outliner

Hello! :slight_smile:

After converting a project to 4.9, I’ve noticed that any child actors created through the Add Child Actor Component node in Blueprints are not shown as nested under their parent actor in the World Outliner anymore, unlike in 4.8.

This doesn’t seem like intended behavior - child actors created manually in the component list still work as expected.

57341-ue4-bpbug-childactorattachment1.jpg

57342-ue4-bpbug-childactorattachment2.jpg

As an addendum, it seems like child actors created through child actor components at runtime or through blueprint construction scripts (using the Add Child Actor Component node instead of adding the child actor component manually) in general don’t seem to be attached to the actor that created them. Using blueprint logic to e.g. moving a child actor component does not move the child actor that belongs to it.

Hi Kashaar,

That is expected behavior with Child Actor’s created at runtime but any created in the Construction Script should show in the World Outliner. I just tested this and this is my results:

Adding manually: Listed

Runtime: Not listed (only listed during play)

Construction Script: Listed

Are you not seeing this?

Hi TJ,

I’ve done some further investigation, and the culprit seems to be the Set Child Actor Class node, which can be used to dynamically set a child actor’s class after it was created. If creating a Child Actor in the construction script, it is attached to its parent actor as expected. But using the Set Child Actor Class node, the Child Actor will not be attached.

I’ve uploaded a small project that reproduces all three cases of this:

  1. manually created child actor
  2. child actor created in construction script
  3. child actor created in construction script with child actor class set afterwards.

Case 1 and 2 work as expected, but in case 3, the child actor is not attached to its parent.

Repro project

Hi again,

I’ve managed to track down the problem in the engine, and have submitted a fix for it as a pull request on GitHub: https://github.com/EpicGames/UnrealEngine/pull/1536

Basically, here’s what causes this:
Child Actor attachment to parent is handled in the ChildActorComponent’s OnRegister() function, but since the component is already registered when the Child Actor’s class is changed (which leads to the Child Actor being destroyed and a new one created), the new Child Actor never gets attached. Probably just an oversight, but gave me an opportunity to create my first pull request, so there you go :slight_smile:

Since you created a GitHub pull request, would you like us to consider this report resolved until the request is finished? You should be having an open discussion with one of the developers through GitHub.

Sounds good! It seems that the issue is a bit more complicated than my pull request, but yeah - looks like someone is on it!

Seems like this problem still exists? I am using 4.17.2 and still getting this error.