Working on netowrked projectiles

This commit is contained in:
2025-12-08 21:35:24 -05:00
parent 494d76833f
commit ecd15c271f
10 changed files with 86 additions and 9 deletions

View File

@@ -50,11 +50,10 @@ void ADDICharacter::Tick(float DeltaTime)
void ADDICharacter::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
if (OtherActor->Owner == this)
return;
AProjectileBase* Projectile = Cast<AProjectileBase>(OtherActor);
if (HealthComponent && Projectile)
HealthComponent->TakeDamage(10);
}
void ADDICharacter::TakeDamage(int Damage)
{
HealthComponent->TakeDamage(Damage);
}