Hi invoke repeating doesnt repeat it just invoke once but doesnt repeate every second. A little help would be appreciated. Thanks!
Transform Player;
float RotSpeed = 90f;
Vector2 dire;//direction of the bullet
bool isReady;//when bullet set
public GameObject bullet1;
// Update is called once per frame
void Start()
{
InvokeRepeating(“FireBullet”, 1f,1f);
}
void Update()
{
}
void FireBullet () {
if(Player==null)
{
GameObject player = GameObject.Find("Player");
if(player!= null)
{
Player = player.transform;
GameObject bullet = (GameObject)Instantiate(bullet1);
bullet.transform.position = transform.position;
Vector2 direction = player.transform.position - bullet.transform.position;
bullet.GetComponent<EnemyBulletMove>().SetDirection(direction);
}
}