How Do I keep my character from flying away?

Hey guys, when my game starts my character flies away and I cannot figure what is wrong with this script :

#pragma strict
var walkspeed: float = 10.0;
var F = false;
function Jump() 
{ if (F == false);
F = true;
animation.Play("Damage"); rigidbody.AddForce(Vector3.up *15);
yield WaitForSeconds(0.8);
animation.Stop("Damage");
animation.Play("Wait");
yield WaitForSeconds(3);
F = false;
}
function Move() 
{ animation.Stop("Wait");
 animation.Stop("Damage");
 animation.Play("CharWalk");
}
function StoppedMove() 
{ animation.Play("Wait");
 animation.Stop("Damage");
 animation.Stop("CharWalk");
}
function Start() {

}

function Update() {

    rigidbody.freezeRotation = true;
    if (Input.GetKey(KeyCode.W)) transform.Translate(Vector3(0, 0, 1) * Time.deltaTime * walkspeed);Move();
    if (Input.GetKeyUp(KeyCode.W));
    StoppedMove();
    if (Input.GetKey(KeyCode.S)) transform.Translate(Vector3(0, 0, - 1) * Time.deltaTime * walkspeed);
    if (Input.GetKey(KeyCode.A)) transform.Translate(Vector3(-1, 0, 0) * Time.deltaTime * walkspeed);
    if (Input.GetKey(KeyCode.D)) transform.Translate(Vector3(1, 0, 0) * Time.deltaTime * walkspeed);
    if (Input.GetKeyDown(KeyCode.Space) && F == false);
    Jump();
    
}

The issue is that on line 37 you’re doing:

if (Input.GetKeyDown(KeyCode.Space) && F == false);
Jump();

But you really want to do:

if (Input.GetKeyDown(KeyCode.Space) && F == false) Jump();

Because the semicolon after the “if” says to the compiler: if you’re hitting space and F is false then do nothing, then run Jump().
In your case you don’t need the first line in Jump() that checks if F is false because Update won’t call Jump() if F is true (besides you’re still saying: if F is false then do nothing and continue the function, because there’s a semicolon there too).