Download

Weird problem: Unrecognized type FLifetimeProperty

Hello everyone,

I have weird problem with function GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const

Here’s the header code:



UFUNCTION()
		virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const override;


And this is the error with cpp code:
644e896ef551fbac5e31f0600618e6712581bfd8.png

Is there something I have misspelled? Or I have to include any header files?

Just a quick guess, but try including this at the top of your .cpp file:

#include “Net/UnrealNetwork.h”

Just tried to add it… the same error:

http://puu.sh/e0OhV/9bd11eeb09.png

I could be wrong and it may not be relevant to the error but I believe you don’t need to define the GetLifetimeReplicatedProps function in the header as the Unreal back-end automatically does it.

Just removed it and Visual Studio says: Inherited member not allowed

Is your Health variable marked as replicated in the header? If no variables are marked as replicated it won’t automatically generate the function.

Like so:



UPROPERTY(replicated)
float Health;


Yeah that worked. Thanks :smiley: But now I have to start a new thread about why my player does not get killed in multiplayer