Space shooter - why after clicking play the bolt is shooting
Hello,
I have a problem with space shooter tutorial. After clicking play (in unity) the bolt is shooting without any clicking. I checked already code but i don't see any difference between my code and code from tutorial.
Any suggestions?
public float fireRate;
private float nextFire;
void Update()
{
if (Input.GetButton("Fire1") && Time.time > nextFire)
{
nextFire = Time.time + fireRate;
Instantiate(shot, shotSpawn.position, shotSpawn.rotation);
}
}
Comment