The animations play at random within the data table of animations loaded. After playtests I received feedback to change this, so in the future the attacks will follow a combo system instead.
The attacks using conditions of whether the character is busy, before allowing attacks. The attack animations can be rootmotion to stop movement, but I felt this took away from combat.
After conditions are met. The montage plays and AnimNotify handles when the trace should happen for the attacks.
The trace looks for an Enemy channel, adds it to an ignore list, so the actor doesn't receive multiple hits.
The trace locations are based off sockets that are on the weapon skeleton. With each weapon I add I just apply the same sockets in the locations the trace needs to happen. This allows weapons to be easily added.
Ranged Attack
Systems
Health System
Energy System
UI System
Animation System
VFX / Audio System
Ability System
Components
Attribute Component
UI Component
VFX / Audio Component
Animation Component
Ability Component
Breakdown
The ranged attack holds a lot of similarities to the melee attack.
Conditions are checked that the player isn't currently busy using in a montage or has enough energy.
An actor is spawned and AnimNotify handles VFX / Audio
Lock-on
Systems
Lock-on System
UI System
Animation System
Components
Lock-on Component
Interfaces
Combat Interface
Breakdown
The combat interface was just to update the widget, so the player was aware of which enemy they were locked onto.
The Lock-on system definitely is fairly easy to implement, but it needs refinement.
There is a trace that looks for enemies and it sets the character rotation to the enemy actor that comes back valid. If the enemy dies, or the player goes too far away, then they drop the actor as a lock-on target.
With proper animation blendspaces the players legs and upperbody could rotate accordingly to the lock-on, but Mixamo doesn't offer that refined of animations.