- Home /
Why does it say You must Fix all compiler errors to enter play mode?
I have been having a problem with the code for the camera script in the Car Tutorial. It was telling me I had to add semicolons that were already there. I eventually fixed that problem and the Compiler errors at the bottom went away. So my camera script is perfect but when I try to enter play mode, it says, "All compiler errors must be fixed before you can enter play mode!" But I already fixed the problems and there aren't any errors to be fixed.
None can answer this question unless you post the code.
There must still be some errors there... You sure that Error showing isn't deactivated by accident? check the 3 little buttons on the top right of your Console window.
#pragma strict
var car : Transform;
var distance : float = 6.4;
var height float = 1.4;
var rotationDamping : float = 3.0;
var heightDamping : float = 2.0;
var zoomRacio : float = 0.5;
private var rotationVector : Vector3;
function Start () {
}
function LateUpdate () {
var wantedAngel = car.eulerAngels.y;
var wantedHeight = car.position.y + height;
var myAngel = transform.eulerAndels.y;
var myHeight = transform.position.y;
myAngel = $$anonymous$$athf.LerpAngle(myAngle,wantedAngle,rotationDamping*Time.deltaTime);
myHeight = $$anonymous$$athf.Lerp(myHeight,wantedheight,heightDamping*Time.deltaTime);
var currentRotation = Quaternion.Euler(0,myAngle,0);
transform.position = car.position;
transform.position -= currentRotation*Vector3.forward*distance;
transform.LookAt (car);
}
function FixedUpdate () {
var acc = car.rigidbody.velocity.magnitude;
Camera.fieldOfView = DefaultFOV + acc*zoomRacio*Time.deltaTime;
Oh never $$anonymous$$d I found the errors, but it wants me to add a semicolon on the line var height float = 1.4; but I already put one there. i there anything else wrong with it?
Answer by tanoshimi · Jan 19, 2014 at 08:13 PM
You need to be a lot more careful about accuracy when you're coding. Just from a quick glance at the above code:
var height float = 1.4;
should be var height : float = 1.4;
var wantedAngel
should be var wantedAngle
eulerAngels.y;
should be eulerAngles.y;
eulerAndels.y;
should also be eulerAngles.y;
var myAngel
should be var myAngle
wantedheight
should be wantedHeight
...