Hotbar button shading flickering

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

You may edit your post above.

Generally break the process down into stages:

  1. gather user intent

  2. process user intent and decide how to:

  3. change state of game

Step 3 above will often involve adjusting the UI state to reflect the change, such as graying it out for a cooldown period.

Cooldown timers, gun bullet intervals, shot spacing, rate of fire:

GunHeat (gunheat) spawning shooting rate of fire: