benim hatam nedir yardım edebilecek olan varmı ?
19.04.2014 - 05:21
[code]Assets/follower.js(26,70): BCE0019: 'position' is not a member of 'function(): String'.
[code]
var spawnPoints:Transform;
var waypoints : Transform[];
var distance = Vector3.Distance ;
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[i]=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;
}
}[/code]
2
Görüntülenme
0 Beğeni