Has anyone encountered this problem before, really didn`t know how to fix it

public:
virtual void GetLifetimeReplicatedProps(TArray& OutLifetimePorps) const override;

private:
UPROPERTY(ReplicatedUsing = OnRep_OverlappingWeapon)
class AWeapon* OverlappingWeapon;

UFUNCTION()
void OnRep_OverlappingWeapon(AWeapon* LastWeapon);

the error info is : E0020 identifier “OutLifetimeProps” is undefined

I thinke I did every it need, but the DOREPLIFETIME_CONDITION macro just couldnt correctlly compile, I was really confused and dont know what to do to make it work, is there anyone met this kind of problem before? Really appreciate your help!

Did you add the unreal network include at the top of you cpp file?

#include "Net/UnrealNetwork.h"

Perhaps you have a typo? This compiles correctly


void ABlasterCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const {
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
	DOREPLIFETIME_CONDITION(ABlasterCharacter, OverlappingWeapon, COND_OwnerOnly);
}

Yeah! Actually I do included the header file, but somehow after copying your code it compiles, Still wondering why, but Thanks a lot, this really helps a lot!! :grinning:

When things don’t work I always regenerate my visual studio project, the it automatically refreshes and fixes up underlined includes and broken intellisense.

yeah, I think I did some kind of clean up work, but it just didnt work out very well, just feel its really really difficult when such thing happened :sweat_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.