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?


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!

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

	DOREPLIFETIME(AUACharacter, Pitch);

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: