private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Bottom") { OnBallDeath?.Invoke(); // restick to player paddle rb.velocity = Vector2.zero; transform.position = new Vector3(player.transform.position.x, -3.6f, 0); transform.parent = player.transform; } }
public void Die() { OnBallDeath?.Invoke(this); Destroy(gameObject, 1); }
public void Die() { OnBallDeath?.Invoke(this); Destroy(gameObject, 1); // 1 is the One Second Delay }