herotom99
(herotom99)
June 15, 2016, 3:12pm
1
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.
herotom99
(herotom99)
June 15, 2016, 6:31pm
3
Ok it works, thanks a lot.
DryreL
(DryreL)
December 1, 2022, 4:00pm
4
I already did but still got the error.
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!
1 Like
Ivan3z
(Ivan3z)
May 2, 2023, 2:05am
5
you rock!!
thank you so much!!