- Home /
error help (Javascript)
hello! Im getting the following errors in a script of mine,
Its a way point script if that means anything,
Heres the code- var timer:int = 0;
var player :GameObject ;
var maxRange :int = 0;
function Start () {
}
function Update () {
timer++;
if (timer == 100)
{
timer = 0;
if (gameObject.tag == "waypoint")
{
if (Vector3 .Distance (player .transform.position ,transform.position ) > maxRange )
{
gameObject.tag = "illegal";
}
}
else if (gameObject.tag == "illegal")
{
if (Vector3 .Distance (player .transform.position ,transform.position ) < maxRange )
{
gameObject.tag = "waypoint";
}
}
} {
}
heres the error- waypoint.js(66,1): BCE0043: Unexpected token: .
I just tested this code out, and it works just fine as far as being compiled. $$anonymous$$aybe you posted the wrong section of the code ?
Please format code properly using the code button, and point out the exact line with the issue.
Your answer
Follow this Question
Related Questions
Exception error 1 Answer
Is not a Member of Collisions 2 Answers
My Javascript is not opening 0 Answers
The name 'Message' does not denote a valid type ('not found'). 1 Answer
When I kill one enemy, the rest disapear, but still shoot 1 Answer