So I am making an FPS and there is a list of animations I need a timer for. They animate when the left mouse button is pressed. I want there to be a delay of about .2-.5 seconds before you can click to animate them again. There is a sound on one of them, and if there could be a delay between that too that would be great. They all should play at the same time.
Script No. 1(the one with the sound):
function Update () {
if (Input.GetButtonDown("Fire1")) {
var gunSound : AudioSource = GetComponent.<AudioSource>();
gunSound.Play();
GetComponent.<Animation>().Play("slideAnimation");
}
}
Script No. 2:
function Update () {
if (Input.GetButtonDown("Fire1")) {
GetComponent.<Animation>().Play("gunRecoil");
}
}
Script No. 3:
function Update () {
if (Input.GetButtonDown("Fire1")) {
GetComponent.<Animation>().Play("bulletShoot");
}
}