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:
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”
Young_Wolf
(Young_Wolf)
January 3, 2015, 12:36pm
3
Just tried to add it… the same error:
http://puu.sh/e0OhV/9bd11eeb09.png
Alters
(Alters)
January 4, 2015, 4:38am
4
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
Alters
(Alters)
January 4, 2015, 7:05pm
6
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 But now I have to start a new thread about why my player does not get killed in multiplayer