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