I see nothing wrong with the engine code. It seems You don’t know how to use it. Radial damage use Falloff which means damage will fade with distance.
You should tweak explosion radius/damage and correct impact location, usually projectile hit to character CapsuleComponent or physical asset.
Hint: falloff can be ignored if bFullDamage is set to true;
BUG N°2:
By default UGameplayStatics::ApplyRadialDamage will not cause damage to DamageCauser, in your case DamageCauser == OwnerWeapon->GetWeaponOwner();
I wonder why won’t you debug it yourself, You have full engine source
@Pierdek I'm sorry if you misunderstood. It's not the Engine I claim to have bugs, it's my game :p
I need the Falloff. And, if the Missile directly hits the player, **the player should get the 100% of the Radial Damage **
That doesn’t happen.
I’m having a double edged sword here.
I do want the DamageCauser to be considered during the hit process (the classic ‘haha you killed yourself’).
The ApplyRadialDamage() provides a parameter for specifying a pointer to the Actor to **IGNORE **during the hit process.
I pass a NULL pointer (nullptr) since I want nothing to be ignored.
BUT, how do I prove chain of the Actor who actually shot the Missile?
Let’s say I hit a player character. The character class has the TakeDamage() function which gets called by ApplyRadialDamage() by default.
In that TakeDamage() function I need to do a check like this (pseudocode)
float MyCharacterClass::TakeDamage(float Damage, struct FDamageEvent const& DamageEvent, class AController* EventInstigator, **class AActor* DamageCauser**)
{
if( DamageCauser == me )
Oh, I shot to myself, let's apply damage to myself
else
Oh, that villain hit me with a Missile!
}
The problem is… since I pass a nullptr in the ApplyRadialDamage function, then DamageCauser will be nullptr. How do I refer to the original shooter?
Pass nullptr as DamageCauser, so the Overlap will not ignore this actor, use AController* InstigatedByController instead and check in Your TakeDamage function class AController* EventInstigator.
Take into account direct hit in order to apply full damage: for directly hit actor call UGameplayStatics::ApplyDamage or UGameplayStatics::ApplyRadialDamage with bFullDamage param then call UGameplayStatics::ApplyRadialDamage pass DamageCauser as before.
Write Your custom UGameplayStatics::ApplyRadialDamage