I seem to be having an issue getting the bigExplosionEffect to set active when player is destroyed… What is it that I’m doing wrong? Thanks.
Here is the DestroyController Class…
public class DestroyController : MonoBehaviour {
public GameObject theCanvas;
public DeathCanvas canvas;
public GameObject bigExplosionEffect;
// Use this for initialization
void Start () {
canvas = GetComponent<DeathCanvas>();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
{
Explosion.playerHasDied = true;
DestroyObject(other.gameObject);
DeathCanvas.PlayerIsKilled = true;
}
}
}
Here is the Explosion Class…
public class Explosion : MonoBehaviour {
public GameObject bigExplosionEffect;
public GameObject player;
public static bool playerHasDied = false;
// Use this for initialization
void Start () {
bigExplosionEffect = GameObject.Find("BigExplosionEffect");
bigExplosionEffect.SetActive (false);
player = GameObject.FindGameObjectWithTag("Player");
}
// Update is called once per frame
void Update () {
if (playerHasDied = false) {
Debug.Log ("EXPLODE AND DIE!");
bigExplosionEffect.SetActive (true);
}
}
}