I’ve recently started to work on animations in Unity and I am not sure what I need to do exactly.
I have imported 7 different animations, and all attached to different models. What I am trying to achieve now is, when I click onto the close button on upper-left corner, I would like to close all other animation which is called (GUIClose GUIOpen)
I have tried few things but it didnt work
Do you guys have any idea about what kind of script do I need to use to achieve this? And also I want the animations dont play at the beginning of the scene.
Some screenshots from the interface;
Hope someone could help me, Thanks
If you make the rects you use to render the GUI public, you should be able to animate them.
Sorry I did not get you
What you mean exactly?
Assuming you’re using the OnGUI setup for handling your GUI, you’re using rects to define the screen location of GUI objects. If you make these rects public variables, you can use the animation view to create animations for them.
Actually I am not using anything at the moment. I just dont know what do I need to do to start and stop my animations on a button press 
I have tried something like this ;
function OnMouseOver () {
animation.Stop("Close");
animation.Stop("Open");
}
And put a mesh collider onto the object and ticked the trigger box. But I dont know if thats the right way of doing it or not, as I said I am very new to this animation stuff. I need a proper path to get start I think
I would suggest you tackle this problem one task at a time. It sounds like task one is: “Learn how to build a UI”. Jumping straight to animating something you’ve not yet been able to build statically doesn’t seem like the most fruitful approach.
I would start here: Unity - Manual: IMGUI Basics
Ermm so my quiestion is then, is it possible to use an animation as a button as well or not ? Thanks again
“… possible to use an animation as a button …” - please clarify.
Well all the objects that I got at the moment does have their own animations. For example, is it possible to click onto an object into the left top corner and make the whole animation close?
I think you should go read the article I linked.
I have already looked at it, I am trying something like this now but I can’t see the animation playing, Am I doing something wrong ? I’ve put it onto the object on the left-top corner.
Here’s the code:
function Update(){
if (Input.GetMouseButtonDown(0)){
print("pressed");
//animation.CrossFade("Close");
animation.Play("Close");
animation.Play("Open");
}
}
Can anyone spot what I am doing wrong to play the animation ? Cheers