Added OnRep to health componenet

This commit is contained in:
2026-01-03 00:10:33 -05:00
parent 3b9a02b3b1
commit 7b9a33abfe
2 changed files with 16 additions and 1 deletions

View File

@@ -101,4 +101,15 @@ void ADDICharacter::Server_CharacterHit_Implementation(UPrimitiveComponent* HitC
bool ADDICharacter::Server_CharacterHit_Validate(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
return true;
}
void ADDICharacter::OnRep_Health()
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "Health Replicated");
}
void ADDICharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ADDICharacter, HealthComponent);
}