# Melee Attacking: Line Trace on AnimNotify (Lyra) or Toggled Collision on AnimNotifyState (ActionRPG)?

**URL:** <https://forums.unrealengine.com/t/melee-attacking-line-trace-on-animnotify-lyra-or-toggled-collision-on-animnotifystate-actionrpg/1538756>\
**Category:** Character & Animation\
**Tags:** line-trace, unreal-engine, melee, UE5, Physics, Collision, question\
**Created:** [December 19, 2023, 6:15pm UTC](https://forums.unrealengine.com/t/melee-attacking-line-trace-on-animnotify-lyra-or-toggled-collision-on-animnotifystate-actionrpg/1538756 "2023-12-19T18:15:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwbilyeu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bwbilyeu](https://forums.unrealengine.com/u/bwbilyeu)\
**Post date:** [December 19, 2023, 6:15pm UTC](https://forums.unrealengine.com/t/melee-attacking-line-trace-on-animnotify-lyra-or-toggled-collision-on-animnotifystate-actionrpg/1538756/1 "2023-12-19T18:15:13Z")

</div>

Is there a noteworthy difference or caveat between either approach in a multiplayer game with a dedicated server? There are a few pros/cons that come to mind with each, but I’m not sure either is better/worse (from my limited experience). I’d like to avoid implementing both unless there is a real need to do so.

The Line Trace approach is used in Lyra by Plugins/ShooterCore/Game/Melee/GA\_Melee, while the Toggled Collision is used by melee attacks in ActionRPG by Blueprints/Weapon/WeaponActor.

**Toggled Collision on AnimNotifyState** : This looks like it might work better for slower attacks which the chance to dodge is expected & allowed. It might also work well with weapons that ‘_flare out_’ as they’re used (ex: sword on fire). However, the extra effort/overhead of tracking struck targets during an attack “swing” (to avoid multiple hits per target) and per-hit/overlap invocations are considerations.

**Line Trace on AnimNotify** : This looks like it might be more performant given that it’s a singular line trace that produces an array to iterate over. However, this looks like it could become more problematic with slower attacks (at a glance) and works better with more straightforward types of attacks.
