FOR ... IN ... loop sorting ???

function OnGUI(){
	GUILayout.BeginVertical();
	
	for(var a in animation){
		if(GUILayout.Button(a.name))
		animation.Play(a.name);
	}
	
	GUILayout.EndVertical();
}

My handy lil’ animation tester for double checking frames on a newly imported/frame-split model.

The resulting GUI list often ends up in a completely different order from the Animations[ ] array in the inspector and I can’t seem to find any set of rules for this. I was curious if this was the case with all FOR … IN … loops or just some quirk with animations???[/code]

Generally, the for…in loop doesn’t guarantee an order with collections AND the animations are not guaranteed to maintain a particular order. The animation property is indexed by string values, so it is likely that it is implemented as a hash table internally rather than an a strictly ordered array.