jumping at a specific height (using rigid body)

I want my character to jump when I press the space bar but not to keep going up if I keep holding it. I want to use rigidbody but not character controller. Here is my code:

if (Input.GetKey("space")) {
     	animator.SetBool("Jumping", true );
     	rigidbody.AddForce(0,100,0);
     	}else{
     	animator.SetBool("Jumping", false );
     	} 

PS I have tried GetKeyDown but then my character doesn’t go up at all.

Try GetKeyDown() again, but use:

rigidbody.AddForce(0,1000,0);

This assumes you left your mass at 1.0.