Hello I am very new to Unity and am trying to make a shooting game in which when the space key is pressed down the gun charges then shoots. I want it to wait for 0.3 seconds before the gun fires off because I want an effect to happen with a particle system(I confused animation with effect in the first post). Also the problem the script has is that the bullet would not fire at all when the space is pressed. Here is the scripts I wrote:
void Start()
{
StartCoroutine("Shoot",0.3f);
}
IEnumerator Shoot()
{
yield return new WaitForSeconds (0.3f);
Bam ();
}
void Bam()
{
transform.Translate (0, 0, 12);
}
void Update ()
{
if (Input.GetKey (KeyCode.Space))
Shoot();
}