This is the code I am using to make a simple character have AI, why isn’t it working? It says that ‘Assets/AIgremlin.js(15,1): BCE0044: expecting }, found ‘’.’ My code is this
#pragma strict
function Start ()
{
var theplayer : GameObject;
var speed : float;
var range : int;
var explosion : GameObject;
}
function Update ()
{
range = Vector3.Distance(theplayer.transform.rotation,transform.position);
if (range < 40)
{
transform.LookAt(theplayer.transform.position);
}