UActorComponent replication not working when spawned in Blueprint

When an Actor Component is spawned at runtime in a Blueprint (not in the construction script, in BeginPlay for example) it is improperly replicated which results in the component not being created on the clients. When doing the same from C++ this works fine.

When writing the Actor Component to the network IsNameStableForNetworking() return true. Then when reading the component from the network, bStablyNamed will also be true which results in the new component not being created on the client while it should be.

The reason why IsNameStableForNetworking() returns true for Actor Components spawned though a Blueprint (and not though C++) isn’t clear to me. I have traced the problem to UObject::IsNameStableForNetworking() returning true because IsDefaultSubobject() returns true, because ((UObject*)this)->GetArchetype() != GetClass()->GetDefaultObject(false)returns true.

The documentation of IsDefaultSubobject() says: true if this component was instanced from a template. false if this component was created manually at runtime. which makes this seem like a bug seeing as the Actor Component is spawned during runtime.

Hello,

Wanted to respond here as well to note that this issue has been logged in our system, and you can track it using the link below:

Have a great day,

Sean