[UE4] Quick Note On Using Apply Radial Damage

For this, I was using a line trace that would create an explosion at the target location.  It did not work for a while, though, even though I was drawing the debug sphere on top of the radial damage and it was spawning at the right place.

Why, though?

View post on imgur.com

My first issue was that radial damage requires visibility to the target.  In this image, “End Point” is the impact point in the trace.  This will be ever so slightly within the target it collided with.

Thus, your radial damage will not apply.

There are two ways to fix this.

First solution: Make the Root Component of your explosion (**IT MUST BE THE ROOT COMPONENT**) block WorldStatic (or whatever you don’t want it colliding with), but nothing else.  When moving the explosion to its destination, have it sweep and not teleport.  If it sweeps, it will adjust the end location so that it is no longer colliding with any surface.  The above image works for radial damage if you make this change.

Second solution: This is a bit more brute force approach that you shouldn’t use unless you’re looking for a very specific outcome.  Take the impact normal, adjust it by an amount, add it to the end point, and move to there.  If the Root Component is not set to block world static, the “Sweep” portion of SetActorLocation won’t do anything, so it’s fine to leave it on.

View post on imgur.com

With that said, you should do your best to use the first solution, but sometimes it just isn’t possible, so the second one will work as well in these cases.

Categories: UE4