UCE0001: ';' expected. Insert a semicolon at the end

Hello everybody,

I’m new here. Following tourist “Roll a Ball” but I got error msg when runing.
Assets/scripts/playercontroller.js(12,16): UCE0001: ‘;’ expected. Insert a semicolon at the end.

the error is happen on
Vector3 movement =new Vector3 (x,y,z);
doubt if I was wrong with when identify Vector3 movment ?

#pragma strict
var player:Rigidbody;

function Start () {
	player = GetComponent.<Rigidbody>();
}

function FixedUpdate () {
	var moveHorizontal= Input.GetAxis ("Horizontal");
	var moveVertical= Input.GetAxis("Vertical");
	Vector3 movement =new Vector3 (moveHorizontal,0,moveVertical);
	player.AddForce(movement);
}

Your problem is that you’re using the c# implementation in Javascript for declaring the Vector3 variable.

To explicitly type the variable you would not use the c# version:

Vector3 movement =new Vector3 (moveHorizontal,0,moveVertical);

Instantiating a new Vector3 that Javascript supports while explicitly declaring it’s type takes a different form in Javascript. Using var with no type relies on Unity’s scripting implementation(boo) to basically figure out the type through Type Inference(using the right side of the equals sign and it’s related type).

var movement:Vector3  =new Vector3 (moveHorizontal, 0, moveVertical);

find out what’s wrong.

Seems can’t use Vectore3 to declare movement in JS.

change to var movement, everything will be fine.