I’m a newbie and making a game where you are a ball and you roll around and stuff but when I scripted the jumping it stopped working and gave the errors, expecting ), found ‘=’.
Also ‘;’ expected. Insert a semicolon at the end. But I’m not aware of where I have missed a semi colon. Could anyone help me please?
Here’s the code it is not very long
var rotationspeed = 100;
var jumpheight = 8;
private var isFalling = false;
function Update ()
{
//Handle ball rotation.
var rotation : float = Input.GetAxis ("Horizontal") * rotationspeed;
rotation *= Time.deltaTime;
rigidbody.AddRelativeTorque (Vector3.back * rotation);
if (Input.GetKeyDown(KeyCode.W) && isFalling == false);
(
rigidbody.velocity.y = jumpheight;
)
isFalling = true;
}
function OnCollisionStay ()
{
isFalling = false;
}