I want to be able to shoot my fireballs every few seconds so that it will match my animation that shoots it. So the script will only work every few seconds or as long as it takes for the animation to finish. How would I go about doing this?
heres my script
var bullitPrefab:Transform;
function Update ()
{
if(Input.GetButtonDown("Fire2"))
{
var bullit = Instantiate(bullitPrefab, GameObject.Find("fireball").transform.position, Quaternion.identity);
bullit.rigidbody.AddForce(transform.forward * 1000);
}
}