March 2019
Intermediate to advanced
708 pages
17h 9m
English
For those that want to add a bit of optimization to their code, instead of our current DOREPLIFETIME macro, you could use the following instead:
void AChapter_12Character::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const{ Super::GetLifetimeReplicatedProps(OutLifetimeProps); // Replicate to every client //DOREPLIFETIME(AChapter_12Character, JumpCount); // Value is already updated locally, so we can skip replicating // the value for the owner DOREPLIFETIME_CONDITION(AChapter_12Character, JumpCount, COND_SkipOwner);}
This makes it so that the value is only replicated on other clients and not the original value.
Read now
Unlock full access