Problem with replication, gets error with GetLifetimeReplicatedProps
I get the following error when I try to use this line of code:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, ReplicatedUsing = HeadScaleUpdated, Category = Pawn)
The problem is with the ReplicatedUsing keyword. I have had this exact problem with the "replicated" keyword on a UPROPERTY before. What should I do to resolve this error?
Error 24 error LNK2001: unresolved external symbol "public: virtual void __cdecl AIntegratedCharacterNoAI::GetLifetimeReplicatedProps(class TArray &)const " (?GetLifetimeReplicatedProps@AIntegratedCharacterNoAI@@UEBAXAEAV?$TArray@VFLifetimeProperty@@VFDefaultAllocator@@@@@Z) C:\Users\sgjkbd\Desktop\ProjectAngelis\ProjectAngelis\Intermediate\ProjectFiles\IntegratedCharacterNoAI.cpp.obj ProjectAngelis
asked Mar 05 '15 at 07:29 PM in C++ Programming
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.
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".
Follow this question
Once you sign in you will be able to subscribe for any updates here