//when the ball hit the ground private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Ground")) { BallPosReset(); } if (collision.gameObject.CompareTag("Goal")) { if (myGameManager.CheckWin()) { myGameManager.GameWin(); } else { BallPosReset(); } } }