Enum is not being replicated

Hi there,

I created an enum variable in my Header file:

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Defaults, Replicated)
         TEnumAsByte<EBattleParty::Type> CapturedByParty;

After that I’ve put it in my replicated Props function:

void ASomCapturePoint::GetLifetimeReplicatedProps(TArray < FLifetimeProperty > & OutLifetimeProps) const
{
     Super::GetLifetimeReplicatedProps(OutLifetimeProps);
     DOREPLIFETIME(ASomCapturePoint, CapturedByParty);
}

But when I change the value of the enum like this on the server

CapturedByParty = EBattleParty::BP_None;

it doesn’t get changed on the client but only on the server. Is there anything I am doing wrong? Are enums a special case when it comes to replication?

1 Like

Is the Actor replicated and is it relevant?

1 Like

Oh god ■■■■ it… It has been a while since I set up replication for an Actor. -.-
Setting bReplicates and bAlwaysRelevant to true in the constructor did the trick for me.
Thank you very much!