I have exported a FBX of a character from maya into Unity. i am trying to assign the animation clips to some GUI buttons I have created. so when one button is pressed a short animation will play
I have broken down the animation clips.
-1st is called idle frames 1-2 (where i would want the action to start and remain until GUI buttons are pressed) -2nd is called raise arm frames (15-33)
-2nd is called raise neck frames (44-78)
i am trying to assign theses animations to this GUI control script for the buttons. The script i have for the GUI buttons is
function OnGUI () { //background box GUI.Box (Rect (10,130,100,90), "Controls");
//Make first button
if (GUI.Button (Rect(20,160,80,20), "Arm")){
}
//Make second button
if (GUI.Button (Rect(20,190,80,20), "Neck")){
}
}
This is as far as I have gotten. i am new to Java and am not sure how to assign the animations to the GUI buttons. So when each button is pressed it plays the animation clip once. Any help would be greatly appreciated. Thanks.