Creating A Cool-down System In Unity

Corey Daniely
2 min readMay 30, 2023

--

#GameDesign #CSharp #Unity #LearnToCode

Relating the cool down system to the firing method it makes since to implement the cool down system inside the player script. Right now, Inside the script there is no logic that defines the fire delay or cool down system is like every 0.5 seconds I hit the space key. That’s what I need to create. I need to define a logic that says how tell when time has passed.

Creating a variable will help with holding or define the cool down delay.

Ideally I want a 0.5 seconds delay every time I hit the space key to do this it’s possible through a concept of passing time called Time.time. Time.time is basically every second the game has been running.

Utilizing the next.Fire variable helps determine if it’s okay to hit the space key again. The next.Fire variable helps with checking to see if 0.5 seconds has passed.

--

--