How can I achieve spam without ruining an animation?

So I want the user to spam the mouse button but the attack animations get stuck because of the spam, how can I resolve this?

You want to restart the animation on each click?
If so you could for example set the animation to have a transition from “Any State” set by a trigger and set the following:

  • Has Exit Time = false
  • Transition Duration = 0.01
  • Can Transition To Self = true

You can see also the following images