I am doing a tutorial for Unity and i keep getting two error messages. Assets/ScriptActorEnemy.js(15,17): BCE0043: Unexpected token: var.
and also Assets/ScriptActorEnemy.js(15,20): UCE0001: ‘;’ expected. Insert a semicolon at the end.
I am new to Unity and don’t know whats going on. Please Help!! Here is my script :
#pragma strict
//Enemy Script
//Inspector Variables
var numberOfClicks : integer = 2;
//Private Variables
//Update is called every frame
function Update ()
{
if (numberOfClicks <= 0);
{
var position = Vector3 (Random.Range(-6,6),Random.Range(-4,4),0);//creates random position
transform.position = position; //moves game object to a new position
numberOfClicks = 2;
}
//RespawnWaitTime is used to hide game object for a set amount of time and then unhide it.
function RespawnWaitTime ()
{
}
//RandomColor used to changematerial of a game object.
function RandomColor ()
{