Variable replication problem

Hi, why when I replicate the variables on the Header files with the UPROPERTY(Replicated) macro, the compiler gives to me “unresolved external symbol”, and with UFUNCTION(Reliable, Server, WithValidation) that already exists, while it’s nowhere in the .cpp file?

http://puu.sh/d2tEB/bc340e2b51.png

http://puu.sh/d2tHo/b53564d7bd.png

Hey!

Whenever you declare a UFUNCTION, you have to define the FunctionName_Validate() and FunctionName_Implementation() instead of FunctionName() in the.cpp (where the validate one has bool as return type (for your needs you’ll want to let it return true all the time) and the implementation void)
You should probably take a look at https://wiki.unrealengine.com/Networking/Replication!

Good luck :slight_smile:

Thanks. It works. I solved the Variable replication problem too. I had to do this:


#include "UnrealNetwork.h"
void AUACharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);

	DOREPLIFETIME(AUACharacter, Pitch);
	DOREPLIFETIME(AUACharacter, Yaw);
}

Okay, nice :slight_smile: Couldn’t see any UPROPERTY related problem, as the errors were only UFUNCTION related :wink: (in the error window)
Btw you should go for the Output log in the future instead of the error window (in my opinion) as VS sometimes throws stranges errors, that might not be real errors (as the code is actually compiled by the Unreal Build Tool) and therefore the actual output of the UBT is way more informative :slight_smile: