How do you replicate a uobject?

Thanks for the help! I think I implemented IsSupportedForNetworking and GetLifetimeReplicatedProps properly, but when I try to override ReplicatedSubobjects I get an error saying, “method with override specifier ‘override’ did not override any base class methods”.

My code:

bool UItem::IsSupportedForNetworking() const 
{
	return true;
}

void UItem::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);

	DOREPLIFETIME(UItem, Item);
}

bool UItem::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
{

}

Thanks for the help.

edit: It seems here that the method ReplicateSubobjects exists in AActor. Did you mean to override a different method?

edit 2: So it seems like you don’t use the override keyword because its the first declaration of the method. But now I don’t know what to put in the function to replicate the item structure.

1 Like