Quick answer: Track the time since the last shot and only fire when it exceeds the weapon's shot interval, accumulating leftover time so the rate is frame-rate independent.
On a high-refresh display the gun melts ammo because it fires every frame. The cooldown is counted in frames, not seconds. Gating fire on real elapsed time fixes the rate everywhere. Here is how.
How to fix it
1. Gate on elapsed time
Store nextFireTime and only fire when time >= nextFireTime, then set nextFireTime = time + 60f / roundsPerMinute. The rate now depends on seconds, not frames.
2. Carry leftover time forward
When firing, advance the timer by exactly the shot interval (not 'now') so fractional overshoot from a slow frame is not lost, keeping the long-run rate exact even with variable frame times.
3. Catch up multiple shots if needed
For very high rates of fire on low frame rates, loop while the accumulated time covers more than one interval so the weapon does not under-fire on frame hitches.
Catching the ones you can't reproduce
The hardest version of this to fix is the one you can't reproduce — it only happens on a player's hardware, OS, driver, or save state, under conditions that simply aren't present on your machine. A report that says “it crashed” or “it froze” gives you nothing to act on, so the bug survives release after release while quietly costing you players.
Automatic error capture closes that gap. Each failure arrives with its full stack trace, the device and OS, the build number, and a breadcrumb trail of what the player did right before it broke, so even a failure you have never seen becomes a specific, reproducible issue. Fold identical failures into one signature ranked by how many players each hits, and your worklist sorts itself worst-first instead of arriving as a stream of vague complaints.
This is where a tool like Bugnet earns its place. Its SDK captures every Unity error automatically with the full stack trace plus device, OS, memory, build, and game-state context, folds duplicates into one grouped issue with an occurrence count, and ties each to the build it first appeared on — so you fix the problem that hurts the most players first and confirm it is gone when its signature disappears from the next release.
Reproduce it once with full context and the fix writes itself. The hunt is the expensive part.