Is this a bug in MonoDevelop? I do NOT see what is wrong
I keep getting the error "Assets/GameScripts/CarTorqueGenerator.js(85,1): BCE0044: expecting }, found ''."
As you can see that error says its on line 85 but I dont even have anything on that line. My code stops at line 84. Tried copying and pasting it into a new .js but that came up with the same error. Google search gave no help so I came here.Any help at all would be appreciated.
Code:
#pragma strict
var wheelFrontLeft: GameObject;
var wheelFrontRight: GameObject;
var wheelBackLeft: GameObject;
var wheelBackRight: GameObject;
var wheelFrontLeftTorque: int=100;
var wheelFrontRightTorque: int=100;
var wheelBackLeftTorque: int=100;
var wheelBackRightTorque: int=100;
var wheelTurnRotationAF: float= 1.571;
function Start () {
}
function Update () {
if (Input.GetKeyDown("w")) {
wheelFrontRight.constantForce.enabled=true;
wheelFrontLeft.constantForce.enabled=true;
wheelBackRight.constantForce.enabled=true;
wheelBackLeft.constantForce.enabled=true;
wheelFrontRight.constantForce.relativeTorque= Vector3(0,1,0)*wheelFrontRightTorque;
wheelFrontLeft.constantForce.relativeTorque= Vector3(0,1,0)*wheelFrontLeftTorque;
wheelBackRight.constantForce.relativeTorque= Vector3(0,1,0)*wheelBackRightTorque;
wheelBackLeft.constantForce.relativeTorque= Vector3(0,1,0)*wheelBackLeftTorque;
}
if (Input.GetKeyUp("w")) {
wheelFrontRight.constantForce.enabled=false;
wheelFrontLeft.constantForce.enabled=false;
wheelBackRight.constantForce.enabled=false;
wheelBackLeft.constantForce.enabled=false;
}
if (Input.GetKeyDown("s")) {
wheelFrontRight.constantForce.enabled=true;
wheelFrontLeft.constantForce.enabled=true;
wheelBackRight.constantForce.enabled=true;
wheelBackLeft.constantForce.enabled=true;
wheelFrontRight.constantForce.relativeTorque= Vector3(0,1,0)*wheelFrontRightTorque*-1;
wheelFrontLeft.constantForce.relativeTorque= Vector3(0,1,0)*wheelFrontLeftTorque*-1;
wheelBackRight.constantForce.relativeTorque= Vector3(0,1,0)*wheelBackRightTorque*-1;
wheelBackLeft.constantForce.relativeTorque= Vector3(0,1,0)*wheelBackLeftTorque*-1;
}
if (Input.GetKeyUp("s")) {
wheelFrontRight.constantForce.enabled=false;
wheelFrontLeft.constantForce.enabled=false;
wheelBackRight.constantForce.enabled=false;
wheelBackLeft.constantForce.enabled=false;
}
if (Input.GetKeyDown("d")) {
wheelFrontRight.constantForce.enabled=true;
wheelFrontLeft.constantForce.enabled=true;
wheelFrontRight.transform.RotateAroundLocal(Vector3.right, wheelTurnRotationAF*Time.deltaTime);
wheelFrontLeft.transform.RotateAroundLocal(Vector3.right, wheelTurnRotationAF*Time.deltaTime);
if (wheelFrontRight.transform.localRotation.eulerAngles(Vector3(0,45,0))) {
wheelFrontRight.constantForce.enabled=false;
wheelFrontLeft.constantForce.enabled=false;
}
}
if (Input.GetKeyDown("a")) {
wheelFrontRight.constantForce.enabled=true;
wheelFrontLeft.constantForce.enabled=true;
wheelFrontRight.transform.RotateAroundLocal(Vector3.right, wheelTurnRotationAF*Time.deltaTime*-1);
wheelFrontLeft.transform.RotateAroundLocal(Vector3.right, wheelTurnRotationAF*Time.deltaTime*-1);
if (wheelFrontRight.transform.localRotation.eulerAngles(Vector3(0,-45,0))) {
wheelFrontRight.constantForce.enabled=false;
wheelFrontLeft.constantForce.enabled=false;
}
}
LOLS! I hate it when I do noobie 101 mistakes too. As my reacted would be palm face sigh. I feel your pain. xD
Answer by Lovrenc · Jan 17, 2013 at 01:58 AM
You are missing } at the end. You didn't close Update method.
Answer by sourabhd · Jan 17, 2013 at 02:16 AM
Dang it -_- rookie mistake. Thanks!
Happens.
For future endouvers on this page:
a)Use comments to comment (e.g. this should not be written under an answer as it is not an answer to the question.
b)Tick answer if it was correct and helped you solve your problem.