I have created simple animation in .fbx in blender and import it into the unity. The animation name is simple_anim and the animation will work fine when i play the button. But now i have added two GUI button and i want when i press gui button then the animation will run…I am new to script and i have written this simple script but its not working fine.
function onGUI()
{
if(GUI.Button(Rect(10,10,150,100),"Button"))
{
animation.play("simple_anim");
}
}