//update is called once per frame void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player") { player.hurt = true; player.Damage(2); } else { player.hurt = false; } }
//update is called once per frame void OnCollisionEnter2d(Collider2D coll) { if (coll.gameObject.tag == "Player") { player.hurt = true; player.Damage(1); //StartCoroutine (player.knockback (0.02f, 350, transform.position)); } else { player.hurt = false; } }