Im trying to have my boss shoot a circular burst of bullets when its health equals 0.
using UnityEngine;
using System.Collections;
public class BossBurst : MonoBehaviour {
public GameObject bossAttack;
public float bulletSpeed;
public Transform firePoint;
public GameObject bullet;
private float pinkBoBotAICurrentHealth;
// Use this for initialization
void Start ()
{
GameObject CurrentHealth = GameObject.Find ("CurrentHealth");
pinkBoBotAICurrentHealth = GameObject.Find ("The Pink Bobot").GetComponent<PinkBobotAI> ().CurrentHealth;
if (pinkBoBotAICurrentHealth >= 0) {
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, bulletSpeed);
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (-bulletSpeed, -bulletSpeed);
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (-bulletSpeed, 0);
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (-bulletSpeed, bulletSpeed);
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, bulletSpeed);
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (bulletSpeed, bulletSpeed);
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (bulletSpeed, -bulletSpeed);
Instantiate (bossAttack, firePoint.position, firePoint.rotation);
GetComponent<Rigidbody2D> ().velocity = new Vector2 (bulletSpeed, 0);
}
}
// Update is called once per frame
void Update () {
}
}