void OnTriggerEnter(Collider other) { if (other.tag == "Player") { player_Health playerFalls = other.gameObject.GetComponent <player_Health> (); playerFalls.makeDead(); } else { Destroy(gameObject); } }
// Use this for initialization void Start() { nextDamage = Time.time; thePlayer = GameObject.FindGameObjectWithTag("Player"); thePlayerHealth = thePlayer.GetComponent <player_Health> (); }