I am trying to make a shoot script. I have done this before in other projects but for some reason it just isn’t registering that I am pressing the left mouse button. I recently upgraded to Unity 5 so I am not sure if this is affecting it. Here is my shoot script:`
var bullet : GameObject;
var isShooting : boolean = false;
function Update () {
if(Input.GetMouseButton(1)) {
isShooting = true;
Shoot();
}
if(Input.GetMouseButtonUp(1)) {
isShooting = false;
}
}
function Shoot () {
while(isShooting) {
Instantiate(bullet, this.transform.position, this.transform.rotation);
yield WaitForSeconds(0.4);
}
}