var waypoints : GameObject[];
var sortedWaypoints : GameObject[];
function Start()
{
waypoints = GameObject.FindGameObjectsWithTag("waypointTag");
sortedWaypoints = new GameObject[waypoints.length];
for (g in waypoints)
{
sortedWaypoints[g.GetComponent(waypointScript).ID] = g;
}
}
try that
↧