My game character has subobjects that need to be replicated. So, followed the wiki about networking subobjects.
In the sample code it has
bool AReplicatedActor::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
{
bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
if (Subobject != nullptr)
{
WroteSomething |= Channel->ReplicateSubobject(Subobject, *Bunch, *RepFlags);
}
return WroteSomething;
}
And in my code:
bool APSCharacter::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
{
bool bWroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
if (PrimAug != nullptr)
{
bWroteSomething |= Channel->ReplicateSubobject(PrimAug, *Bunch, *RepFlags);
}
// TODO: include above code for other replicated subobjects
return bWroteSomething;
}
When this function is in the code and I try to simulate the level it loads the default map which is the level loader.
When I change the default map to the level I want to test, simulating 2 players I am able to use the PrimAug subobject, but no longer see the other player.
So, what are your thoughts? How can I get this working properly? What do I need to do?
Thanks for the help,