(Before I start I have no knowledge in scripting or coding and have only used Unity 5.2 for about 30 minutes.)
I recently added something into the script of my game to allow my ball to jump. I went back into unity to test it and 4 error messages showed up in the console.
Assets/BallControl.js(17,22): BCE0044: expecting ), found ‘=’.
Assets/BallControl.js(17,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/BallControl.js(17,34): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/BallControl.js(17,34): BCE0043: Unexpected token: ;.
I have tried many things to try to fix it. This is my script for the controls of my ball:
#pragma strict
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;
GetComponent.().AddRelativeTorque (Vector3.back * rotation);
if (Input.GetKeyDown (KeyCode.W))
(
rigidbody.velocity.y = jumpHeight;
)
}
If anyone could help me with this it would be appreciated.
Thank you.