Skip to main content
Discovery icon for Official Unity Discord Discord server

Official Unity Discord

31,894 Online
140,061 Members
# 💻┃code-beginner3 people

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
Summarized from recent messages, might be inaccurate

More conversations

Talk, Play, &
Hang Out

Find your space to hang out, discuss the latest updates with the party chat, and see who's down to join your next match.
Get App