Along with what said, my take (since I’m implementing melee in my game).
I actually check for overlaps with the sword first, using a branch and a “has tag” approach (i.e. I tag the sword’s capsule as a Hurtbox, and tell enemies to filter collision except from hurtbox-tagged components).
THEN I perform a sphere trace (not a line trace, as in my experience it’s far too easy for melee attacks to fail to register if the animation’s frames don’t line up right, the traces will sometimes just miss the target entirely, especially if the swing is a big angular arc and you hit the enemy on the bottom half near the legs) for a specified duration to determine the bone hit. I do it this way because it seems to me that firing off traces constantly is both unnecessary and probably a pretty heavy performance hit.
Also of note is that the sword should definitely have collision data for interacting with WorldStatic and WorldDynamic objects IF AND ONLY IF it can be dropped in the world and needs to simulate physics there. Otherwise it’s unnecesarily complicated; if the sword is attached to the actor, the sword will resist pushing through walls, but the actor’s skeletal mesh will be animation-driven, and this can lead to unpredictable results. Honestly it’d be better to just let the sword clip through environmental geometry when wielded by a player, in my humble opinion. I think most players will be willing to suspend their disbelief if the alternative is unpredictable movement behavior near walls on account of the sword.