Hi, I am trying to use UObject as the data class for my Inventory system in an online game, which means the UObject has to support replication.
I followed this post to implement the replication
The data all replicates fine via ReplicateSubobject but I am getting an error message, and I have no idea what does it actually means.
Based on the error message, it sounds like all the sub objects have to be in the parent actor but that means all data have to be in the parent actor which doesn’t sound quite right…
Here is how it works :
Player’s Inventory(ActorComponent) has a list of Slot (UObject)
when Player picks up the WeaponItemActor (Actor), the WeaponItemActor will be added into Player’s Inventory’s unoccupied Slot.
WeaponItemActor has a WeaponItemData (UObject) that contains information such as number of bullets in the gun, compatible ammo type, which AmmoItem(UObject) it is currently using etc.
The moment I pick it up, the following error occurs
LogNetTraffic: Error: UActorChannel::ReadContentBlockHeader: Sub-object not in parent actor. SubObj: WeaponItemData /Game/FirstPersonCPP/Maps/UEDPIE_1_FirstPersonExampleMap.FirstPersonExampleMap:PersistentLevel.BP_WeaponActor2.WeaponItemData_0, Actor: FirstPersonCharacter_C /Game/FirstPersonCPP/Maps/UEDPIE_1_FirstPersonExampleMap.FirstPersonExampleMap:Persis tentLevel.FirstPersonCharacter_C_1
However, all data seems to be replicating just fine. So I am not really sure what this error message means or indicates. I have searched around and found a couple of posts stating the same thing but I do not quite understand them. Would appreciate if anyone can shine some light on why this error message is popping up and what does it mean.
Note: The WeaponItemActor lives in the scene and creates WeaponItemData in its BeginPlay()