Download

Making the first shot instantaneous

I was following a tutorial on youtube and it said to make a timer to set the delay between shots to create the RPM of a gun. I found that to get the delay you need to divide 60 by the rpm wanted but the first shot is not instant. I found this when making a slow firing weapon. The weapon had almost like a windup before it shot, is there any way to fix this?
https://www.youtube.com/watch?v=9PNcnF-2f0g
9c7ef99f85794baa503119b21d77d8cd93798e3c.png

Thanks for any responses in advanced!

I had a similar problem when I had a mining mechanic in my block game, it would have a delay before the first hit. Here was my solution:

This method will also not let people with rapid-fire mouse/controller mods work, or at least it shouldn’t. If you want them to be able to shoot faster than the RPM (as fast as they can click), then set the ‘mineDelay’ to 0 upon mouse release.

You could use delay like I do in my situation as well if you’d like, I’m not sure how timers work, or what the timers execute when done, but my method would have the same effect as yours. Instant first click/shoot, and delay for the rest.

Thanks so much, I added a quick if statement to check the weapons so I can add different rpm for each!

Again thanks for you response

You can just use a Branch with a Boolean, call the boolean “Can Fire” make the default True. When you fire, have the branch check to see if Can Fire is true. If true Set Can Fire to false, perform firing logic, delay, set can fire true. This prevents turbo click firing and allows you to use a delay/timer as the firerate

Glad I could help, turns out i’m not the only one who runs into my problems making my game.

Well, only difference between mine & your solutions is that mine uses a float, yours uses a delay.