hey guys! I’ve got some problems with a stationary enemy. I want the enemy to rotate along whit the player and fire when every 3rd second straight forward. but it only fire once and the bullet follows the player like a missal. here is the code Im using:
var Player : Transform;
var Bullet: Rigidbody ;
var BulletSpeed : int;
private var timer = 0.0;
function Update ()
{
transform.LookAt(Player);
timer += Time.deltaTime;
if (timer > 3)
{
timer = 0.0;
var tempBullet: Rigidbody;
tempBullet = Instantiate(Bullet, transform.position, transform.rotation);
}
}
please help! thanks