Toggle on/off looping auto attack

If you use the boolean like you are now, you can do something like:

Input 
if not AAActive
    then:
         Set Timer -> Save return value to variable (named for example AATimer)
         Set AAActive to true
    else:
         Get AATimer -> Clear and invalidate timer
         Set AAActive to false

That’s all you should need, and then the Auto Attack function doesn’t need the branch
Also, perhaps you could change your timer’s rate to be your attack cooldown instead of 1 second

You can also use a Flip Flop to avoid having to use a boolean
A flip flop just alternates between the two states, so first time execution reaches the node A will be executed, second time B will be executed, then A, then B and so on

1 Like