I’m trying to sort a list of transform objects by the gameobject name. But it doesnt seem to work. There is no error. The skript just stops there.
var potentialWaypoints : Array = waypointContainer.GetComponentsInChildren( Transform );
potentialWaypoints.sort(function(a : Transform,b : Transform) {
if(a.gameobject.name < b.gameobject.name) return -1;
if(a.gameobject.name > b.gameobject.name) return 1;
return 0;
});