Weird problem: Unrecognized type FLifetimeProperty

Hello everyone,

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

Here’s the header code:

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

And this is the error with cpp code:

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:

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:

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