how to make a cooldown timer
Use Time.deltaTime in Update instead of relying on FixedUpdate or arbitrary frame counts to build reliable cooldown timers.
- Update and FixedUpdate are Unity message methods returning void, not void entities themselves
- Having both Update and FixedUpdate does not harm performance, and worrying about it early is premature optimization
- When counting down timers, check if the variable is less than or equal to zero to avoid missing exact equality
- Subtract Time.deltaTime each frame in Update to decrement timers accurately in seconds
- FixedUpdate runs at a fixed timestep of 50Hz by default, but deltaTime handles time consistency for most standard gameplay logic


