void OnTriggerEnter(Collider col) { if (col.gameObject == player) { playerHealth.setHealth(0.0f); zombie.Play(); } }
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Player") { Instantiate(explosion, transform.position, Quaternion.identity); gasFill.enabled = true; gasFill.Play(); explosion.Play(); playerHealth.setHealth(140.0f); Destroy(gameObject); } }