i need help with a jump script i get no errors but it just wont work right

the ball just flys up when i push play not when i push space

[QUOTE
]var jumpVelocity : float = 20;

function Update () {

if (Input.GetButtonDown(“Jump”));

rigidbody.AddForce(0,jumpVelocity,0);
}
[/QUOTE]

Try removing the semicolon at your if-statement

if (Input.GetButtonDown("Jump"));

Should be

if (Input.GetButtonDown("Jump"))

Also, you’ll want code tags, not quote tags: http://forum.unity3d.com/threads/143875-Using-code-tags-properly

thanks for the reply and for telling me the right way to show a Code XD it works kinda now it doesn’t fly up when i push play now but it also doesn’t go up when i push space XD

var jumpVelocity : float = 20;

function Update () {

if (Input.GetButtonDown("Jump"))

        rigidbody.AddForce(0,jumpVelocity,0);
}

The amount of force is probably small as you are only adding the force during the one frame when the user has pressed the space button. You can increase the amount of force but I believe you’ll want a jumping animation effect? In that case, you’ll want a boolean to set so you can add the force you want until the maximum allowed height and disallow jumping.

Try increasing the amount of force first. If that is not the result you want, try the second method which is to keep adding force until the object has reached a certain height and allow gravity to make it fall.

lol i just had to add more force