Converting shoot delay (debounce) to Rounds Per Minute (RPM)

Hello. I have browsed for posts regarding weapon firerates in search of a method to convert a delay based rate of fire to a rounds per minute based rate of fire.
This is the closest thing I could find in the forum.
However, I did not understand how this method works and how I could use it for a “rounds per minute” rate of fire calculation for my automatic weapon. The debounce delay works well, but converting it to RPM would make it easier for me to configure.

Basically, what I have right now is a debounce. While the mouse is held, the gun will fire, and if the mouse is still held after 0.08 seconds, it will fire again. How could I set a Rounds Per Minute value and calculate the delay using it?

1 Like

Better to use an accumulator to handle fire rate.

1 Like

I have never used such a method. Could you explain to me how I would implement that into my code? Thank you.

1 Like

I took some minutes to read the post you linked me and I still don’t know what to make of it, and I still don’t know how to do the conversion I initially intended to do.

Bump. Still looking for a way.

Can you explain what exactly rpm is and how it’s different from just debouncing? It would help us understand so we can help you better

It’s just 60/ rpm from unit conversion.

rpm = bullets / minute

1/ rpm = minute/bullet
60/ rpm = seconds/bullet

@BlueBloxBlast
RPM (Rounds Per Minute) is basically how many times a gun can shoot in a minute (not counting how much ammo is loaded and other factors). For example, an AK-47 assault rifle can shoot 600 rounds per minute.

@dthecoolest
I was trying to convert earlier, but was getting numbers that were most definitely incorrect for my debounce. I will try the solution you linked me, and I will let you know if it works as desired.

It worked just as I wanted. Thank you.