Making a consistent jumping system

So, I have a jumping code that uses raycasts:

function Update () 
{
	var direction = transform.TransformDirection(Vector3.down);
	var hit : RaycastHit;
	var localOffset = transform.position;
	
	if (Physics.Raycast (localOffset, direction, hit, 1) && Input.GetKey("up"))
	{
		rigidbody.AddForce (Vector3.up*200);
	}
}

My problem with this code is that it is inconsistent. Sometimes it barely hops, other times it explodes off the screen. Is there a way to better this code (or an entirely different method?)that I could use to make more consistent jumping?

The problem I see with this code is that ‘Input.GetKey(“up”)’ is triggered as long as you hold the key down. Either try Input.GetKeyDown( “up” ), which is only triggered once when you hit the jump key, or use some kind of condition to see if you are already airbound, in which case you would not execute the jump logic.

The first solution is easier, but players may still rapidly hit the jump key to jump higher so the latter is recommended.