A little bit of help with jump

so i have been trying to make my rigidbody jump,problem is that it only jumps once then it won’t execute the action.

Here is the code

void Start () {
ground = true;

}

// Update is called once per frame
void Update () {
	if (Input.GetKey(KeyCode.Space) && ground == true) {
		rb.AddForce (Vector2.up * Jumpforce);
		ground = false;
	}
	if (Input.GetKey (KeyCode.D)) {
		rb.AddForce (Vector2.right * speed);
	}

}

	void OnCollision2DEnter(Collision2D col){
	if (col.gameObject.tag == "Ground") {
		ground = true;
	}
}
 void OnCollision2DExit(Collision2D coly){
	if (coly.gameObject.tag != "Ground") {
		ground = false;
	}
}

}

I made a simple tut here about jump

Pls subscribe

For anyone that is looking at this post,I’ve found a workaround

void OnCollisionExit2D (Collision2D coly)
	{
		grounded = false;
	}
	void OnCollisionEnter2D (Collision2D cols)
	{
		grounded = true;

this works for my case,but if there is any wall or any other collider,with this script your object will be allowed to make a second jump.Hopefully this will help others