Step 8 — Animating the Powerup
The powerup should look flashy when it appears so as to catch the player’s attention. We shall give it an animation.
To begin go to Window → Animation → Animation to bring up the Animation tab, assuming it doesn’t already exist in your layout somewhere.
Click on the Powerup object in the Hierarchy (called PowerupExample here) to highlight it in the Animation tab. Click “Create”. You will be prompted to name the .anim file you are about to create. Give it a suitable name and location in the Assets to save into. Now you should see the tab filled with a timeline.
The GameDevHQ Filebase provides a set of sprites to create the animation, which is a text color change across the sprites. Drag the sprites into this Animation tab. Now you can click the Play button to see how the animation looks like.
You should note that this Powerup object’s Inspector now shows an Animator component.
This references a Controller, which controls what animations to play (what .anim files you’ve saved). When you open the PowerupExample Controller this tab will be in focus.
Nothing to change here at the moment, so we’re done!