Disable Button for a while

I want it so that when i press the mouse button, it disables it for some time with a WaitForSeconds. So what is the function to disable a mouse button?

A simple way would be something like:

bool disableFiring = false;
float firingDisableDuration = 5.0f; // or whatever time you want

void MouseButtonPressed()
{
  if( !disableFiring )
  {
    Fire();
    disableFiring = true;
    Invoke("EnableFiring", firingDisableDuration );
  }
}

void EnableFiring()
{
  disableFiring = false;
}

I hope that helps.

I'm afraid you cannot "disable a mouse button" but disable the script that contains the call to GetMouseButton.

In your program, simply use a boolean variable (depending on the structure of your program, maybe it will need to be static) that gets changed to false everytime you click, and check for it just before you call GetMouseButton.

Then, you can wait for waitForSeconds to reset your boolean to true again...

I'm sure there are more elegant approaches than that, try to centralize all the mouseButton calls in a script to keep things tidy.