Our moles will randomly popup from their holes so that the player can bash them with the mallet. To do this, we have to build a simple animator which tells the mole how and when to move:
- Create a new folder called Animators in the Project panel.
- Select Window | Animation from the main menu. We will use this window to set keyframes for the Mole GameObject's position.
The Animation window (shown in Figure 8. 4) is used to create animation clips for individual GameObjects. The following steps involve creating the popup animation for our mole. For the pop-down animation, we will play this animation in reverse: