I’m trying to create a melee system in the ThirdPerson C++ template that uses the mouse button to start an attack, playing a short “raise weapon” animation and once the animation reaches the end if the mouse button is held down there is a charging animation that plays for as long as the button is held. Once the mousebutton is then released the charging attack plays a swinging attack animation that is offset by the time it took to charge which would control where the animation starts playing from. Example: Full charge would play from the start of the swing animation, while short charge plays from closer to the end. This creates a damage system based on the “power” of each swing.
I have implemented the simple attack raise animation playing on mouse click already, now comes the fun part.
So after thinking about it for a little while I came to the conclusion (with my low level of knowledge) that using an anim notify/anim-notify-state event at the end of the raise animation to trigger a check if the player is holding the mouse button would work well. If it is held down, it will then flip a “isCharging” Boolean to true and play the charging animation, and then each tick as long as the mouse button is held a frame count starts and when the mouse button is released the Boolean is flipped to false, and the attack animation plays at the offset frame.
I have been using C++ primarily, but I am aware that powerful things can be done in the animBP. How would I go about implementing this? If there seems like a better way to do it please share your ideas.
I struggled to decide where to post this, if it is better in the C++ section please let me know.
-Thanks