How to trigger an animation properly?

Hi,

Since I’m new to Unity3D I started creating a simple game menu and animated the buttons.
Currently I have a Main Menu and an Option Menu in one scene. I can switch between the menus by clicking on an ‘OPTIONS’ and a ‘BACK’ button.

Every time I switch between the Main and Option menu the animation of the buttons are starting (Fade in the buttons). How can I prevent this? I need the button animation (fading) only on startup of the whole app and then never again.

Does someone has an idea or can give me a hint how to solve this?

Okay!
Considering your animation name as
“HomeLoadingAnim” , “optionMenuAnim” , “helpMenuAnim”

  1. Tap on the Game Object which has animation component in it
  2. Open Animator (windows ->Animation → Animator)
  3. Now you’ll see “Entry” “Any State” “Exit” and the above mentioned animations
  4. Make “HomeLoadingAnim” as default animation (right click and select)
  5. Now select “Any State” and make transition to “optionMenuAnim” (by right clicking on any state)
  6. Now In left side select Parameters and create Triggers and Name it “playOptionAnim” (you can name it anything)
  7. Now select the transition line (from any state to optionMenuAnim) , now Inspector will open up , select the above trigger (hope you know how to do it)
  8. Now In code you have to do the following thing

//Add this below line in the function which opens the option menu
anim.Settrigger(“playOptionAnim”);