I am trying to deal radial damage to nearby pawns, but I’m having trouble figuring out how to create my FRadialDamageEvent struct properly. I have the following code which calls TakeDamage():
Usually the damage returned by Super::TakeDamage is the same passed on DamageAmount, but if you have TakeDamage overrides on the parent classes of that class it’s safer to use what you’re doing. Anyway, i would suggest debugging and stepping into the Super::TakeDamage function to figure out why 2.f as a parameters somewhere along the way became 0.
Yeah, I was hoping to avoid that. I’m not building from source so I don’t have the engine code to debug through, but it looks like I’m going to have to.
Just try with different values or try using FPointDamageEvent to see if the return value is still different from the one you pass as a parameter to try to narrow it down.
Ok, so I figured out what was wrong. I stumbled across the function UGameplayStatics::ApplyRadialDamageWithFalloff(…) which shows how to form the request properly and you need to fill out a field in the struct which contains all the component hits. Based on everything I’d read, I assumed that the fact you are calling Opponent->TakeDamage() you did not need to supply this, but you do.