float AShooterCharacter::TakeDamage(float DamageAmount, struct FDamageEvent const &DamageEvent, class AController *EventInstigator, AActor *DamageCauser)
{
float DamageToApply = Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
DamageToApply = FMath::Min(Health, DamageToApply);
Health -= DamageToApply;
UE_LOG(LogTemp, Warning, TEXT("Health: %f"), Health);
return DamageToApply;
}
I hit the AI with a gun as shown in the picture. But the log doesn’t show up, and if I shoot and get hit somewhere as shown in the picture below, the effect appears, but it doesn’t only show up to the AI.
If you go near the AI and shoot, the AI’s stamina is only reduced. There are logs, too.
But sometimes I think I’m aiming at AI and shooting, but it doesn’t really reduce my stamina. Is it because I’m not doing well in testing…
It feels like you have to shoot a certain area to reduce your stamina.