I have an actor for chestbox - ABChestbox. It includes actorComponent UInventory* inventory. UInventory have TArray (UInventoryItem) items; UInventoryItem = child of UObject
All replication rules are checked, for this setup.
ABChestbox:
ABChestbox has bReplicated = true
ABChestbox → UInventory has UPROPERTY(Replicated)
ABChestBox has GetLifetimeReplicatedProps, with DOREPLIFETIME(ABChestBox, inventory);
It shouldn’t need to be implemented, because Inventory is an actor component and AActor already implements that for components.
UInventoryItem should also override GetWorld function to get proper world from it’s parent:
if (const UObject* MyOuter = GetOuter())
{
return MyOuter->GetWorld();
}
Make sure InventoryItem is created by the server
I might be missing something, but in the past I’ve referenced this site to do similar thing and it worked fine, see and check if you have everything needed - it has things like GetFunctionCallspace and CallRemoteFunction, but these are for calling RPCs on your object and replication itself should work fine without them I guess, but you can try and implement everything.
the array replicates, the pointers inside it do not. on the client there is no UInventoryItem instance to point at, so every slot resolves to null, which is exactly what you see.
King_Zero is right that the component does not need its own ReplicateSubobjects override and the GetWorld override on the item matters. what is missing is registration, each item has to go into the replicated subobject list of the actor that owns it, and it has to be created on the server only with a stable outer. a replicated TArray of UObject pointers carries the references, it doesnt create the objects.
if you want to stay in blueprint that registration is exactly the piece you cannot write yourself. blueprint object replication from fab is a UObject replication plugin that hosts the objects on a component, server creates them, clients get them with their rep notifies, ue5.0 to 5.8.