So in my enemy script, i have where i want the enemy to shoot lasers on certain levels. I got it where it can shoot on level 2, but when it hits like level 3, 4,5,6 and etc. they stop shooting after they get to that level. Here is my script
var level: int;
var nextShot: float = 0;
function Update () {
transform.Translate(Vector3(0,-1* speed * Time.deltaTime ,0));
if ( level == 2 && 3 && 5 && 6 && Time.time > nextShot){
Shoot();
nextShot = Time.time + fireRate;
}
}
If yu can help thank you! this has to be so easy and im really confuse why it was not shooting.
↧