Creating a cooldown system is a lot simpler than you think.
First things first, you need to create your variable within your code so Unity knows what you are trying to do.
Typically you are going to have 2 variables that have important roles when creating your cool down; the fire rate which dictates how quickly you fire and the “can fire” rate that dictates how often you fire.
Both of these variables will be private but the fire rate will be a serialized field so you can edit as you go in the Unity Inspector.

Now let’s get into the actual code of creating a cooldown system. You will utilize [Time.time], which is how long the game has been running in seconds, and your _canFire code you created earlier. Here’s what that should look like:
Read Morehttps://medium.com/@jmick.work23/creating-a-cooldown-system-7c4baf89d45c