GetLifetimeReplicatedProps not defined

Hi,
I don’t know why, I can’t use GetLifetimeReplicatedProps in my “ADefaultCharacter” because it doesn’t compile.

cpp:

#include "UnleashedHorde.h"
#include "DefaultCharacter.h"

#include "Engine.h"
#include "UnrealNetwork.h"

void ADefaultCharacter::GetLifetimeReplicatedProps(TArray<class FLifetimeProperty> &OutLifeTimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifeTimeProps);
}

error: ‘GetLifetimeReplicatedProps’ is not declared in ‘ADefaultCharacter’

Thanks

Have you defined one of your member variables as a UPROPRTY with the Replicated flag? I believe that’s needed in order for the generated files to create that function definition.

Ok it works, thanks a lot.

I already did but still got the error.

image

image

image

Edit: I fixed the problem.

1- Wrong spelling. Case sensitive.

2- “virtual void GetLifetimeReplicatedProps(TArray < class FLifetimeProperty >& OutLifetimeProps) const override;” added to .h

And done!
image

1 Like

you rock!!
thank you so much!!