Cooldowns
The wait before an ability can be used again.
Cooldowns stop players spamming the best move and give each ability a rhythm. The classic bug is counting the wait in frames: on a 144 Hz screen 30 frames is a fifth of a second, so the same weapon fires more than twice as fast as on 60 Hz. Count in seconds instead.
Try this: Hold fire on Frames mode at 144 fps and watch the shots per second. Switch to Seconds and it is the same at every frame rate.
Hold fire.
Prompt bit
Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.
Add cooldowns measured in seconds, not frames: store the time each ability becomes ready, block use until the game clock passes it, default 0.5 s, and keep the clock running during menus only if intended, so pausing cannot be used to skip a cooldown.
Add a reusable cooldown system for abilities, attacks and items (2D or 3D, any engine). Each ability stores cooldownDuration in seconds (default 0.5 s for basic attacks, 3 to 10 s for specials) and readyAt, a timestamp on the game clock. Use is allowed when gameTime >= readyAt; on use set readyAt = gameTime + cooldownDuration. Never count frames. Use scaled game time so pause and slow motion affect cooldowns correctly, and unscaled time only for UI animation. If an attack is held, fire as soon as it is ready, and buffer a press made in the last 0.1 s of a cooldown so mashing feels responsive. Support cooldown reduction as a multiplier applied at use time, and charges (n uses that refill one per duration) for dashes. Expose remaining = max(0, readyAt - gameTime) so the UI can draw a radial fill and a number, and play a small cue when an ability becomes ready. In multiplayer, the server owns readyAt.
Where it's used
- MOBAs and action RPGs: ability bars with radial timers
- Shooters: fire rate, grenades and ultimate abilities
- Platformers: dash and double-dash recharge
- Survival and crafting: item use and respawn timers
- Mobile games: energy and ability buttons
Common mistakes
Counting cooldowns in frames (faster on high refresh screens), using real-world time so pause skips cooldowns, resetting the timer when a press is refused, and not showing the remaining time so players think the button is broken.
Writing this with an AI assistant? See our best AI coding assistants for game developers.
Missing a concept? Request one.



