UGameplayStatics::ApplyRadialDamageWithFalloff
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallableBlueprintAuthorityOnly
Description
Applies radial damage with a configurable falloff curve from a full-damage inner radius to a minimum-damage outer radius. Unlike ApplyRadialDamage, this version allows you to control the damage gradient precisely.
Caveats & Gotchas
- • BlueprintAuthorityOnly — this function is a no-op on clients. Ensure it is called from server-side code (authority) only, or the damage event will silently not fire.
- • Only hits components blocking the DamagePreventionChannel (default: Visibility). Actors hidden behind cover on the Visibility channel will not receive damage even if geometrically within the radius.
- • The DamageCauser actor is always excluded from the damage sweep, so a grenade actor will never damage itself.
Signature
static ENGINE_API bool ApplyRadialDamageWithFalloff(const UObject* WorldContextObject, float BaseDamage, float MinimumDamage, const FVector& Origin, float DamageInnerRadius, float DamageOuterRadius, float DamageFalloff, TSubclassOf<class UDamageType> DamageTypeClass, const TArray<AActor*>& IgnoreActors, AActor* DamageCauser = NULL, AController* InstigatedByController = NULL, ECollisionChannel DamagePreventionChannel = ECC_Visibility); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to retrieve the world context. | — |
| BaseDamage | float | Maximum damage applied at the origin (inside DamageInnerRadius). | — |
| MinimumDamage | float | Minimum damage applied at DamageOuterRadius and beyond. | — |
| Origin | const FVector& | World-space epicenter of the explosion. | — |
| DamageInnerRadius | float | Radius within which full BaseDamage is applied. | — |
| DamageOuterRadius | float | Radius at which damage falls off to MinimumDamage. | — |
| DamageFalloff | float | Exponent controlling the falloff curve between inner and outer radii. 1.0 = linear. | — |
| DamageTypeClass | TSubclassOf<class UDamageType> | Class describing the type of damage inflicted. | — |
| IgnoreActors | const TArray<AActor*>& | Actors to exclude from damage. | — |
| DamageCauser | AActor* | Actor that caused the damage (e.g., the grenade actor). Not damaged itself. | NULL |
| InstigatedByController | AController* | Controller responsible for the damage (e.g., the player who threw the grenade). | NULL |
| DamagePreventionChannel | ECollisionChannel | If an actor is blocked from the origin by this channel, it receives no damage. | ECC_Visibility |
Return Type
bool Example
Explosion with quadratic falloff C++
void AGrenadeActor::Explode()
{
if (!HasAuthority()) return;
TArray<AActor*> IgnoreActors;
IgnoreActors.Add(this);
UGameplayStatics::ApplyRadialDamageWithFalloff(
this,
100.f, // BaseDamage
10.f, // MinimumDamage
GetActorLocation(),
150.f, // DamageInnerRadius
500.f, // DamageOuterRadius
2.0f, // DamageFalloff (quadratic)
UDamageType::StaticClass(),
IgnoreActors,
this,
GetInstigatorController()
);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?