How do I add a cooldown timer to skills/inputs?

This is how I would do a cooldown.

When you want to perform the skill you check a timer. In this example it’s called DodgeCooldown. If the timer is less then the current game time you go ahead and perform the skill. After (or before) you’ve performed the skill you update the timer to Current game time + Cooldown time. In my example I add 5 seconds which will mean 5 second cooldown on the skill.

5 Likes