like it said in the title i have a problem in my 2d script made by Kalithumos in youtube. i get Assets/script/movement.js(42,24): BCE0044: expecting :, found ‘=’ why do i have this in the line 36 i don’t have the problem. Please help me!!!
#pragma strict
var leftButton : String;
var rightButton : String;
var forward : Vector3;
var dt : double;
var leftRotation : float;
var rightRotation : float;
var suspended : float;
var moveSpeed : double;
function Start () {
leftButton = "q";
rightButton = "d" ;
forward = new Vector3(0,0,1);
dt = Time.deltaTime;
leftRotation = -0.7071069;
rightRotation = 0.7071069;
suspended = false;
moveSpeed = 3.0;
}
function Update ()
{
if (suspended)
{
return;
}
if ( Input.GetButton(leftButton))
{
transform.rotation.y = leftRotation;
transform.Translate (forward * moveSpeed * dt);
animation.Play("Walk_002");
}
else if (Input.GetButtonDown);
{
transform.rotation.y = rightRotation;
transform.Translate (forward * moveSpeed * dt);
animation.Play ("Walk_002");
}
}
function SetSuspension(setting : boolean)
{
suspended = setting;
}