Assets/follower.js(23,61): BCE0019: 'position' is not a member of 'Object'. HELP.....

HELP ME

var spawnPoints:Transform;
private var waypoint=new Array();
private var mesafe:float;
private var sayac:int=0;
function Start () {

var i=0;
for (var child:Transform in spawnPoints){


   waypoint*=child;*

i++;

}

}

function Update () {

mesafe=Vector3.Distance(transform.position,waypoint[sayac].position);
transform.LookAt(waypoint[sayac].position);
transform.Translate(Vector3.forward/0.5);
if (mesafe<=1){
sayac++;

}
if(sayac>=waypoint.length){

sayac=0;

}

}

You haven’t declared the variable spawnPoint as an Array.

Try:

var spawnPoints:Transform[];

instead of

var spawnPoints:Transform;

Good luck!

The error message is saying that this:

waypoint[sayac].position

is a problem… it’s a problem because of the way you declared

private var waypoint=new Array();

The compiler doesn’t know what type if things are going into waypoint, so it’s calling them Objects. You should do something more like this:

var waypoints : Transform[] = new Transform[10];

That’ll make an array with 10 spaces for waypoints.