Fire rate script? or is my unity broke?

Hi, I’ve tried several methods for Rate-Of-Fire in unity and nothing works. GameObjects are just con tinuesly spawned with no delay in all the methods i have looked up and tried, how do you do Rate of Fire C#? starting to think theirs somthing wrong in my version of unity, have googled and looked up on youtube for the last 3 days with no sucsess.

There are several ways of doing this, for example you could do something like this (not tested):

public class Weapon : MonoBehaviour {

   public float delay = 2.0f;
   private bool readyToFire = true;

   void Update(){
      if (Input.GetMouseButtonDown(0) && readyToFire){

   IEnumerator Fire(){
      readyToFire = false;
      // TODO -- add code to instantiate the projectile here.

      yield return new WaitForSeconds(delay);
      readyToFire = true;

Might not be exactly what you need but should work in most cases, if you need more specifics feel free to provide any scripts you currently have or more info. Other examples of how to do it can be found here an answers as well.

Finally, here is some info about Coroutines if you have any questions: Unity - Scripting API: Coroutine