private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { SceneConfig.KillPlayer(); } }
// Start is called before the first frame update private void OnCollisionEnter2D(Collision2D collision) { if (collision.collider.tag == "Player") { SceneConfig.KillPlayer(); } }
private void OnCollisionEnter2D(Collision2D collision) { float fallSpeed = GetComponent <Rigidbody2D>().velocity.y; if (collision.collider.tag == "Player" && fallSpeed < -1) { SceneConfig.KillPlayer(); } }