Child actors are not properly destroyed on clients
Steps to reproduce:
On the server, both main and child actors are destroyed. However, on the client, the child actor still exists.
UChildActorComponent::DestroyChildActor has 2 assumptions, that work against each other.
Because of this, if an ActorChannel for this actor already exists (the actor was destroyed after the client joined in), it will be properly closed in UNetDriver::NotifyActorDestroyed. However, if it doesn't, a new ActorChannel will be later created on client, thanks to the DestroyedStartupOrDormantActors list, but it will fail to link itself with any actor (because of the renaming) and will end up deleting nothing.
The issue can be worked around, using NetLoadOnClient = false on the child actor, but it creates unnecessary overhead of creating and deleting extra actors on startup, and significantly complicates scripting workflow, because, on clients, it kills the guarantee, that child actors exist in the main's actor BeginPlay.
asked Jun 23 '17 at 02:07 PM in Bug Reports
Sorry for the delay. I spent some more time testing this, and it appears if you add a brief delay (.5 seconds or so), the child actor will destroy properly. This leads me to believe that it is an order of operations issue, meaning that it's possible the actor hasn't been fully initialized when you are attempting to delete it, which is causing the child actor to remain on the client. If it is this issue, unfortunately would require a large overhaul of the current system to resolve. At this point, I'd recommend trying to add a brief delay in to see if that resolves the issue for you guys. If not, let me know and I can continue to investigate.
answered Jul 05 '17 at 08:08 PM
Sean L ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here