# ApplyRadialDamageWithFalloff Not applying falloff damage

**URL:** <https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362>\
**Category:** Pipeline & Plugins\
**Tags:** damage-sense, unreal-engine, editor, UE4, CPP, question\
**Created:** [February 5, 2020, 10:55am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362 "2020-02-05T10:55:05Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 10:55am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/1 "2020-02-05T10:55:05Z")

</div>

I’m trying to create a quake style rocket launcher and am trying to use UGameplayStatics::ApplyRadialDamageWithFalloff to do so. When an actor is within the outer damage radius they are given the base damage regardless of where they are positioned. my inner damage radius is 17 and my outer damage radius is 450.

Here is my code for the projectile:

```
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "FPSProjectile.generated.h"

class UProjectileMovementComponent;
class USphereComponent;
struct FRadialDamageParams;

UCLASS()
class AFPSProjectile : public AActor
{
	GENERATED_BODY()

protected:

	/** Sphere collision component */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Projectile")
	USphereComponent* CollisionComp;

	/** Projectile movement component */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Movement")
	UProjectileMovementComponent* ProjectileMovement;

	UPROPERTY(EditDefaultsOnly, Category = "Explosion")
	struct FRadialDamageParams ExplosionDamage;

public:

	AFPSProjectile();

	/** called when projectile hits something */
	UFUNCTION()
	void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);

	/ **Returns CollisionComp subobject** /
	USphereComponent* GetCollisionComp() const { return CollisionComp; }

	/ **Returns ProjectileMovement subobject** /
	UProjectileMovementComponent* GetProjectileMovement() const { return ProjectileMovement; }
};

```

Here is my code for the actor taking damage:

```
#include "FPSTestDummy.h"
#include "Components/StaticMeshComponent.h"
#include "Components/BoxComponent.h"
#include "Math/UnrealMathUtility.h"

// Sets default values
AFPSTestDummy::AFPSTestDummy()
{
 	// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	MeshComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComp"));
	MeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision);
	RootComponent = MeshComp;

	BoxComp = CreateDefaultSubobject<UBoxComponent>(TEXT("BoxComp"));
	BoxComp->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
	BoxComp->SetupAttachment(RootComponent);

}

// Called when the game starts or when spawned
void AFPSTestDummy::BeginPlay()
{
	Super::BeginPlay();

	CurrentHealth = StartingHealth;
	
}

// Called every frame
void AFPSTestDummy::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

float AFPSTestDummy::TakeDamage(float DamageAmount, struct FDamageEvent const& DamageEvent, class AController* EventInstigator, AActor* DamageCauser)
{
	int32 DamagePoints = FPlatformMath::RoundToInt(DamageAmount);
	UE_LOG(LogTemp, Log, TEXT("Damage is:%d"), DamagePoints);

	CurrentHealth -= DamagePoints;
	if (CurrentHealth <= 0)
	{
		Destroy();
	}
	return DamagePoints;
}

```

 ![296387-annotation-2020-02-05-220013.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/8/b0871096307301aca2268a40e321525737440d7a.png)

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 11:39am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/2 "2020-02-05T11:39:08Z")

</div>

Hello Headhunter,

Have you made sure that the damage falloff exponent is not equal to zero, that the inner damage radius is less than the outer radius and the bFullDamage parameter isn’t true?

Regards,

Vecherka.

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 11:41am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/3 "2020-02-05T11:41:21Z")

</div>

The damage falloff is set to 1. the inner damage radius is 17 and the outer is 450. How do i set bFullDamage? I’m really new to Unreal so you’ll have to bare with me haha

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 11:43am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/4 "2020-02-05T11:43:24Z")

</div>

Could you send us the actual call of the ApplyRadialDamageWithFalloff method? I’m sorry the bFullDamage parameter is something from an older version of the engine, sorry about that.

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 11:53am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/5 "2020-02-05T11:53:30Z")

</div>

Sure, i forgot to put it in the initial question, sorry.

```
void AFPSProjectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
	// Only add impulse and destroy projectile if we hit a physics
	if ((OtherActor != NULL) && (OtherActor != this) && (OtherComp != NULL) && OtherComp->IsSimulatingPhysics())
	{
		OtherComp->AddImpulseAtLocation(GetVelocity() * 100.0f, GetActorLocation());
	}

	if (ExplosionDamage.BaseDamage > 0.0f)
	{
		UGameplayStatics::ApplyRadialDamageWithFalloff(this, ExplosionDamage.BaseDamage, ExplosionDamage.MinimumDamage, GetActorLocation(), ExplosionDamage.InnerRadius, ExplosionDamage.OuterRadius, ExplosionDamage.DamageFalloff, UDamageType::StaticClass(), TArray<AActor*>(), this, Instigator->GetController());
		DrawDebugSphere(GetWorld(), GetActorLocation(), ExplosionDamage.InnerRadius, 20, FColor::Black, false, 10, 0, 1);
		DrawDebugSphere(GetWorld(), GetActorLocation(), ExplosionDamage.OuterRadius, 20, FColor::Purple, false, 10, 0, 1);
	}

	MakeNoise(1.0f, Instigator);
	Destroy();
}

```

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 11:57am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/6 "2020-02-05T11:57:37Z")

</div>

Sorry to bother you again, but could you give us the ExplosionDamage struct values?

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 11:59am UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/7 "2020-02-05T11:59:47Z")

</div>

![296384-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/3/283e50253f50ecba52df79b71a9cdd1c16410e60.png)

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 12:22pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/8 "2020-02-05T12:22:23Z")

</div>

The values don’t seem to be wrong?

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 12:45pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/9 "2020-02-05T12:45:17Z")

</div>

No not really, and to be honest I’m kinda puzzled as this should work as expected. So just a silly question, the projectile doesn’t always hit the dummy does it, or hits something in close vicinity to it?  
The ApplyRadialDamageWithFalloff function generates a FRadialDamageEvent, so it should be treated as one. Furthermore the ApplyRadialDamageWithFalloff function overwrites the DamageType DamageFalloff parameter.

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 12:49pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/10 "2020-02-05T12:49:19Z")

</div>

The projectle hit the floor near the target.

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 1:18pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/11 "2020-02-05T13:18:40Z")

</div>

Would you mind sharing an example screenshot?

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 2:03pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/12 "2020-02-05T14:03:26Z")

</div>

Sure, I’ve added a screenshot to the original question

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 2:49pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/13 "2020-02-05T14:49:26Z")

</div>

Oh my god, totally ignored that. TakeDamage is supposed to handle the damage it receives, so a simple call to the actor class should to the trick. Just replace this line inside the TakeDamage method:

```
int32 DamagePoints = FPlatformMath::RoundToInt(DamageAmount);

```

whit this one

```
int32 DamagePoints = FPlatformMath::RoundToInt(Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser));

```

Sorry for causing such a commotion, totally my mistake.

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 2:55pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/14 "2020-02-05T14:55:07Z")

</div>

No worries. I’ll try that now

---

<div class="post-metadata">

**Author:** ![Headhunter\_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Headhunter\_2](https://forums.unrealengine.com/u/Headhunter_2)\
**Post date:** [February 5, 2020, 3:05pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/15 "2020-02-05T15:05:51Z")

</div>

That worked. Thank you for the help Vecherka

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 3:07pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/16 "2020-02-05T15:07:29Z")

</div>

Glad to hear. Sorry again for overlooking that.

---

<div class="post-metadata">

**Author:** ![Vecherka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vecherka](https://forums.unrealengine.com/u/Vecherka)\
**Post date:** [February 5, 2020, 3:16pm UTC](https://forums.unrealengine.com/t/applyradialdamagewithfalloff-not-applying-falloff-damage/461362/17 "2020-02-05T15:16:09Z")

</div>

Don’t forget to mark this question as answered. So people can find it easier, and to make it clear the question is closed. 🙂
