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.
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.
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:
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:
manually created child actor
child actor created in construction script
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.
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
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.