I have a grenade launcher in my game, and the grenade it shoots explodes automatically on contact with an enemy. This grenade does radial damage with falloff. I’ve noticed that when I hit an enemy mesh at its base (i.e. the white sphere you see if you click an enemy in the editor), it does full damage, but when I hit the mesh further away from this point it does less damage.
I understand that this function is meant to lessen damage the further away the explosion is from what it’s damaging, but it seems odd that if I hit a mesh directly in one place it would do less damage than hitting it directly in another place. Is this intentional, a bug, or am I just messing something up with collisions/the radial damage function?
void ASLauncherProjectile::Explode()
{
if (ensure(ExplosionEffect)) {
UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ExplosionEffect, GetActorLocation(), GetActorRotation());
}
TArray<AActor*> IgnoreActors;
UGameplayStatics::ApplyRadialDamageWithFalloff(GetWorld(), 50.f, 10.f, GetActorLocation(), 50.f, 500.f, 1.0f, DamageType, IgnoreActors, this, GetInstigatorController());
Destroy();
}