BCE0019: 'position' is not a member of 'Object'.
Hello. I have a problem can you help me please?
my problem is BCE0019: 'position' is not a member of 'Object'.
my script is
var spawnPoints:Transform;
private var waypoint=new Array();
private var mesafe:float;
private var sayac:int=1;
function Start(){
var i=0;
for(var child:Transform in spawnPoints){
waypoint[i]=child;
i++;
}
}
function Update () {
mesafe=Vector3.Distance(transform.position,waypoint[sayac].position);
transform.LookAt(waypoint[sayac].position);
transform.Translate(Vector3.forward/4);
if(mesafe<=1){
sayac++;
}
if(sayac>=waypoint.length){
sayac=0;
}
}
Comment