following a book by Micheele Menard as a starting class into unity. During my coding of the third person controller everything checks out in mono devlop but keeps asking a semi colon in the first line. So if anyone could help me out to avoid this problem in the future?
here is my code
var roll Speed = 6.0 ;
var fastRollSpeed = 2.0;
var jumpSpeed = 8;
var gravity =20.0;
var rotateSpeed = 4.0;
var duckSpeed = 0.5;
private var moveDirection = Vector3.zero;
private var grounded : boolean = false;
private var moveHorz = 0.0;
private var normalHeight = 2.0;
private var duckHeight = 1.0;
private var rotateDirection = vector3.zero;
var isControllable : boolean = true;
var controller : CharacterController;
controller = GetComponent(CharacterController);
function FixedUpdate(){
if(!isControllable){
Input.ResetInputAxes();}
else{}
if(grounded){
moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= rollSpeed;
controller.height = normalHeight;
controller.center.y = controller.height/2;
moveHorz = Input.GetAxis("Horizontal");
if(moveHorz>0){
rotateDirection = new Vector3(0, 1, 0);}
else if(moveHorz<0){
rotateDirection = new Vector3(0, -1, 0);}
else{
RotateDirection = new Vector3(0, 0, 0);
moveDirection.y -= gravity * Time.deltaTime;}
if(Input.GetButton ("Jump")) {
moveDirection.y = jumpSpeed;}
if(Input.GetButton("Boost")){
moveDirection *= fastRollSpeed;}
if(Input.GetButton("Duck")){
controller.height = duckHeight;
controller.center.y = controller.height/2+ .25;
moveDirection *= duckSpeed;
}
} var flags = controller.Move(moveDirection * Time.deltaTime);
controller.transform.Rotate(rotateDirection * Time.deltaTime, rotateSpeed);
grounded = ((flags & CollisionFlags.CollidedBelow) !=0);
}