Hi,
I dont get why my script isnt working.
CODE
using UnityEngine;
using System.Collections;
public class PlayerDies : MonoBehaviour {
public GameObject player;
public float delayTime;
public Animator animation;
void Start () {
animation = GetComponent<Animator> ();//notice this isn't Animator, there is a big difference between the two
}
void OnTriggerEnter2D(Collider2D col){
if(col.gameObject.tag == "Bullet")
{
animation.Play("Dying");
Destroy(player);
}
}
void playDeath(delayTime == float){
animation.Play("Dying");
yield return new WaitForSeconds(5);
Destroy(player);
}
}