Problem with replication, gets error with GetLifetimeReplicatedProps

You need to define the GetLifetimeReplicatedProps function in your CPP file.

You replicate UPROPERTYs with Replicated or ReplicatedUsing, and then also add them to GetLifetimeReplicatedProps.

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

	DOREPLIFETIME(AIntegratedCharacterNoAI, YourVariableNameHere);
}

Also, don’t forget to #include “UnrealNetwork.h” in your CPP. And in your main .h file change #include “EngineMinimal.h” to "#include “Engine.h”.

2 Likes