Semicolon expected, but there is one?!

Hello guys!

Ok, so Im banging my head trying to figure out whats going on here, at the moment thinking its going to be a unity error, because I have this script, and where I declare these two vars (freetimermaxrange and freetimermaxadj). Its really werid, and Ive encountered a unity glitch more than once in the two weeks that I’ve been building my game, heres the problematic part of the script:

#pragma strict
//Declare Globals
var npctransform : Transform; //NPC
var target : Transform; //PLAYER
var movespeed : float = 6;
var npcrigid : Rigidbody;
var desiredvelocity : Vector3;
var isGrounded : boolean = false;
var raydistance : float = 5;

enum state{
Idle,
FreeRoam,
Chasing,
Flee
}
var npcstate : state;
var minrange : float = 3;
var maxrange : float = 40;

minrange = minrange * minrange;
maxrange = maxrange * maxrange;
var isChasing : boolean = true;

var freetimer : float = 0;
var freetimermax : float = 5;
//var freetimermaxrange : float 1.5;
//var freetimermaxadj : float 5;
var calcdir : Vector3;
var freetimermaxrange : float 1.5;
var freetimermaxadj : float 5;

//End Declaring Globals

Heres a link to the full script if you would like to have a look at it: http://www.mediafire.com/view/?q6lbtg6133zdpy8

Thanks for your help!

Please use code tags. Have you tried defining these in a function like Start?

function Start()
{
minrange = minrange * minrange;
maxrange = maxrange * maxrange;
}

it made no difference. Thanks for the reply though!

atleast these are missing: =

var freetimermaxrange : float 1.5;
var freetimermaxadj : float 5;

Ah thanks that fixed that, now I got another problem :stuck_out_tongue:

Its telling me its not possible to invoke an expression of a Vector3 type for this: calcdir = Random.onUnitSphere();

Is that the correct syntax?

EDIT: Nevermind, I fixed the issue, removed the (), it was interpreting as a function.