UGameplayStatics::ApplyRadialDamage
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: static
Description
Applies radial damage to all actors within DamageRadius of Origin, optionally with distance falloff and line-of-sight checks. Returns true if any damage was dealt.
Signature
static ENGINE_API bool ApplyRadialDamage(const UObject* WorldContextObject, float BaseDamage, const FVector& Origin, float DamageRadius, TSubclassOf<UDamageType> DamageTypeClass, const TArray<AActor*>& IgnoreActors, AActor* DamageCauser, AController* InstigatedByController, bool bDoFullDamage, ECollisionChannel DamagePreventionChannel) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Any valid UObject in the world. | — |
| BaseDamage | float | Maximum damage at the epicentre. | — |
| Origin | const FVector& | World-space centre of the explosion. | — |
| DamageRadius | float | Radius of the damage sphere in cm. | — |
| DamageTypeClass | TSubclassOf<UDamageType> | Damage type class. | — |
| IgnoreActors | const TArray<AActor*>& | Actors excluded from damage (e.g. the instigator). | — |
| DamageCauser | AActor* | The actor causing damage. | — |
| InstigatedByController | AController* | Controller responsible. | — |
| bDoFullDamage | bool | If true, all actors in range receive full BaseDamage. If false, damage falls off linearly with distance. | false |
| DamagePreventionChannel | ECollisionChannel | Trace channel used to check line-of-sight between origin and each actor. ECC_Visibility by default. | ECC_Visibility |
Return Type
bool Caveats & Gotchas
- • By default uses ECC_Visibility for line-of-sight blocking — actors behind walls won't receive damage. Pass ECC_MAX to disable line-of-sight checks entirely.
- • bDoFullDamage=false applies linear falloff. For custom falloff curves use ApplyRadialDamageWithFalloff instead.
- • Always add the DamageCauser to IgnoreActors to prevent the exploding actor from damaging itself.
Example
Explosion damage on projectile impact C++
TArray<AActor*> IgnoreList;
IgnoreList.Add(this); // Don't damage self
UGameplayStatics::ApplyRadialDamage(
this,
150.0f, // BaseDamage
GetActorLocation(), // Origin
500.0f, // Radius (cm)
UDamageType::StaticClass(),
IgnoreList,
this, // DamageCauser
InstigatorController,
false, // bDoFullDamage — use falloff
ECC_Visibility
);
Destroy(); See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?