Creating a menu with an idle animation
The previous recipes taught you how to make a menu appear or create a transition that allows the menu to enter the screen. We are now going to see how to make an idle animation, where the object just cycles through a general animation, such as hovering or pulsing. To do this, we need to create an animation that can be played as a loop. In this recipe, we will see how to change the color background of the pause menu that we created in the first recipe, Appearing and disappearing menu.
How to do it...
First of all, we need to create a menu. We can follow the first three steps of the previous recipe, Appearing and disappearing menu.
Next, select Appearing Menu and then click on Add Property inside of the Animation window. Once again, Unity asks us to save the animation, so we can simply select a folder and save the animation by naming it IdleAnimation.
Now, in the Animation view, select the Rec button if it is not already selected in Unity. Also select Appearing...