Replication help

I am trying to learn replication and i keep getting these weird errors, i have no idea what they mean.

What i am trying to achieve is all clients have separate health to each other, once one of the clients reach 0 health their actor will be destroyed.



	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Replicated, Category = Gameplay)
		int32 PlayerHealth;

	UFUNCTION(Server, Reliable, WithValidation)
	void CheckPlayerHealth();
	virtual void CheckPlayerHealth_Implementation();
	virtual bool CheckPlayerHealth_Validate();




void AReplicationTestingCharacter::CheckPlayerHealth() {
	PlayerHealth -= 5;
}

void AReplicationTestingCharacter::CheckPlayerHealth_Implementation() {
	if(PlayerHealth <= 0) {
		Destroy();
	}
}

bool AReplicationTestingCharacter::CheckPlayerHealth_Validate() {
	return true;
}


3181449028eb9c2d7b930dee3176f460.png

If you have a replicated variable you need an overridden GetLifetimeReplicatedProps in the CPP or it wont compile. Heres an example:

Character inventory is my variable that is defined with the “Replicated” UPROPERTY tag. Check this out: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums