i have a series of animations of a gear stick and want to cycle through them by pressing a guy button. i have successfully done this with an array of materials but i am struggling to do the same with the animations. below is my attempt at the code. i would be grateful for any help, thank you
var gearIndx : int;
var gears : AnimationClip[];
var car : GameObject;
function OnGUI(){
if(GUI.Button(Rect(10,10,50,50),gearTex)){
gearIndx++;
}
}
function Update(){
car.animation = gears[gearIndx];
}