Attack or spell launching are animation driven : When you launch a spell or an attack, the animation will begin, then when the animation come to a certain time, a feedback will be called to notify the WeaponOwnerComponent (or SpellUser Component for spell launching) that the damage needs to be applied to the target.
Step 01 : We begin the attack from the WeaponOwnerComponent. The AnimationComponent is told to trigger the animation
Step 02 : The AnimationComponent tells the AnimBP to trigger the correct animation
Step 03 : The AnimBP receive the instruction and modify internal variables which will trigger the correct animation.
Step 04 : The animation will play, and the Notify event will be triggered at some time
Step 05 : Once the notify event is trigger, the AnimBP inform the AnimationComponent that the animation as reach a certain point by triggering the OnAnimationFeedback Event Dispatcher of the AnimationComponent.
Step 06 : Because we have already registered the AnimationFeedbackReceived() function inside the OnAnimationFeedback Event Dispatcher during the initialization of the WeaponOwnerComponent, then the triggering of this dispatcher will call this function. We just have to handle the rest of the logic inside this function.