So am having this issue where adding
virtual void GetLifetimeReplicatedProps(TArray < class FLifetimeProperty > & OutLifetimeProps) const OVERRIDE;
to my Character class couses problems (PIE/ Standalone crash), and i have a qustion.
If i add the above function decleration to my Character class and add a replicating property for health.
protected:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category = Health)
float Health;
And the defenition
void AMyProjectPlayerClass::GetLifetimeReplicatedProps(TArray < class FLifetimeProperty > & OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AMyProjectPlayerClass, Health);
}
i get a error when starting a network game, “Unable to find property Health in clas …”
I had a look at the shooter game and i noticed its not decleard in the header for AShooterCharacter::.
So is there somthing else i need to do for this function?
In the API Refrence i found GetLifetimeReplicatedProps(…) in UObject::
So am wondering did i miss some crucal information about this function. On how am suposed to override it?
Thanks for any help on the matter.
For anyone experiencing the same issue it was due to after the Project got Refreshed in visual studio.
The UE Build tool had generated the source files outside my folder sturcrures and thus compiling the wrong / old files.
My quik solution to this was update my Visual Studio project to reflect the structure the Editor wanted. :\
And for the GetLifetimeReplicatedProps(…) its not to be decleard in the class header as as i first tought its part of UObject::