- Home /
ERRORS, Please help: Expecting ), found 'targetXRotation'. (BCE0044)
var cameraObject : GameObject;
@HideInInspector
var targetXRotation : float;
@HideInInspector
var targetYRotation : float;
@HideInInspector
var targetXRotationV : float;
@HideInInspector
var targetYRotationV : float;
var rotateSpeed : float = 0.3;
var holdHeight : float = -0.5;
var holdSide : float = 0.5;
function Start ()
{
transform.position = cameraObject.transform.position + (Quaternion.Euler(0,targetYRotation,0) * Vector3(holdSide, holdHeight, 0)
targetXRotation = Mathf.SmoothDamp( targetXRotation, cameraObject.GetComponent(MouseLookScript).xRotation, targetXRotationV, rotateSpeed);
targetYRotation = Mathf.SmoothDamp( targetYRotation, cameraObject.GetComponent(MouseLookScript).yRotation, targetYRotationV, rotateSpeed);
transform.rotation = Quaternion.Euler(targetXRotation, targetYRotation, 0);
};
Answer by perchik · Feb 28, 2014 at 08:10 PM
Sometimes error messages are cryptic; This is not one of those times. The error says EXACTLY what the problem is (it probably also said something like (20,6) which says the error is on line 20, character 6)
"Expecting ) found targetXrotation instead."
The compiler was expecting to see a right closing parenthesis, and instead ran into targetXRotation. So if you look at the line before targetXRotation, you'll notice that you opened more parens then you closed.
transform.position = cameraObject.transform.position + (Quaternion.Euler(0,targetYRotation,0) * Vector3(holdSide, holdHeight, 0));
so add a closing parenthesis [and a semicolon] at the end of that line and the error will go away
Your answer
Follow this Question
Related Questions
custom function syntax error 1 Answer
How to use if statement with var? 3 Answers
Declaring char or string type variables returns errors 2 Answers
expecting EOF, found '}'. (BCE0044) 2 Answers
Why is this giving me an error? 1 Answer