How to increase attack speed on an auto attack


Hello everyone. I’m trying to create a system that auto-fires a spell. I’ve been able to accomplish that, but I wanted to be able to increase the rate of fire by decreasing the timer by event. Since it’s tied to the event that begins play, it doesn’t work. I tried to invalidate the timer and create a new timer, but that didn’t work either, and after googling around (and looking at a similar question that was asked here), I’m at a loss. The means of getting the upgrade is a UI button that then decreases the timer from 2 to 1. Any help would be appreciated.

What was the problem with invalidating the timer and restarting it? After trying it, it worked for me. Try it while also making sure you use the right variable on the ‘time’ pin of the timer. Your sent images display different variables. Good luck!

Unfortunately, it didn’t work. When using Invalidate Timer by Handle, nothing changes when I click on the fire rate upgrade. When I tried Clear and invalidate timer, the firing stopped all together. Is there something else I should be attaching this to other than event begin player? I should also point out that if I try to put this on the tick itself, it doesn’t fire off either.

Instead of having the timer on the “Begin Play” event, create a custom event. Then, after invalidating the timer, fire that event so that the timer starts again. You do not need the tick event for this.

1 Like

You can access the the input action Threshold and increase the attack speed from there too. So basicly when you hold your key it has default rate how fast you shoot. If you change that it will automaticly shoot faster or slower however you set it.

Edit i guess i missread that you have auto attack and is not set on a key. Else this is a nice way to do it for faster attacks when pressing a key.

But yeah the timer by event should work. What time is set in the “Fire rate” variable ? The time value of “Timer by event” works like if you set 0.2 it means it will then fire every 0.2 sec so 5 times a sec…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.