Help with a script.

Hi everyone, first off, I’d like to say sorry if this is in the wrong spot, but here it goes.

I’m having trouble with this script

#pragma strict

var rotationSpeed = 100;
var jumpHeight = 8;

private var isFalling = false;

function Update () {
    //Moves left/right on x axis
    var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
    rotation *= Time.deltaTime;
    rigidbody.AddRelativeTorque (Vector3.back * rotation);
   
    //Makes the ball jump on the Y axis with W.
    if (Input.GetKeyDown (KeyCode.W) && isFalling == false)
   
    (rigidbody.velocity.y) = jumpHeight;
    isFalling = true;

}

function OnCollisionStay
(
    isFalling = false
)

I’m getting the errors

Assets/Movement.js(24,19): BCE0043: Unexpected token: =.
and
Assets/Movement.js(26,1): BCE0043: Unexpected token: .

Which I don’t understand-I don’t have anything on line 26??

The script is for movemen and a simple jump.

I’m using Unity 4

You’ve should have parentheses after function OnCollisionStay, and a semicolon after isFalling = false, and you should have curly braces around your function, not parentheses. Look at the Update function, it’s correct there.

Syntax errors like these will often propagate beyond where the actual error is.

Thank you very much. I knew i was most likely an easy fix :slight_smile: