Best way to do melee collisions?

I’m currently using collision volumes and turning on/off the collision with anim notifies. I noticed that I often hit/get hit more than once per attack, despite the collision only being active for a very, very short time. Is there a better way to handle melee collisions, or a fix for multiple collisions happening?
I’m using “on event begin overlap” to trigger damage.

1 Like

Maybe use Do Once node after a Hit Event and reset it when the animation is over?

Hi, create a new actor array variable. When you start the attack clear the array and every time you hit an actor check if it is in the array. If it is not in the array then execute your damage code then add it to the array. If it is in the array do nothing. That way each actor can only be damaged once during the attack.

I tried exactly this and had numerous problems with it.

First the OnBeginOverlap didn’t suffice as the animation driven movement of the weapon didn’t sweep. This caused massive problems with hit detection especially in multiplayer situations as you could sometimes punch through an actor without triggering a hit event (if your animation is too fast, because one tick the weapon is before, and the next tick it’s already through the actor).

I had to save the location of the collider every tick and the next tick do a box sweep collision detection in order to register hits.

As for your problem with hitting the same actor multiple times, like chrudimer already said, you’ll need an array and add every hit actor to the array. When using the box tracing method you can just put this into the “actors to ignore” pin and clear it every time you start an attack.

Hope this was helpful! Cheers