For a shooter project, I created a health component to place on the player and enemy actors. I bound events for the component’s owner receiving point and radial damage within the component itself:
GetOwner()->OnTakePointDamage.AddDynamic(this, &UHealthSystem::TakePointDamage);
GetOwner()->OnTakeRadialDamage.AddDynamic(this, &UHealthSystem::TakeRadialDamage);
I’m focused on getting point damage right before worrying about radial damage. I have a weapon actor that performs a line trace for hitscan shooting, which is supposed to apply point damage:
UGameplayStatics::ApplyPointDamage(HitResult.GetActor(), WeaponStats.Damage, HitResult.TraceStart, HitResult, GetInstigatorController(), this, UDamageType::StaticClass());
My syntax is fine as far as I can tell; logging has confirmed that the right actors are being hit by the line trace. And yet I don’t understand why point damage isn’t being applied…and I made sure to copy the parameters that I found for OnTakePointDamage:
UFUNCTION()
void TakePointDamage(AActor* DamagedActor, float Damage, class AController* InstigatedBy, FVector HitLocation, class UPrimitiveComponent* FHitComponent, FName BoneName, FVector ShotFromDirection, const class UDamageType* DamageType, AActor* DamageCauser);
I’ve hit a roadblock. Does anyone know what the issue might be?