Animating a Sprite in Unity.

Today’s article is about how to animate a sprite. We’re going to be animating our new Shield Powerup sprite to draw a little more attention to it when it’s coming down the screen.

First, we need to make sure we have the Shield Powerup prefab in the hierarchy.

Drag Shield Powerup prefab into the Hierarchy.

Next, with the Shield Powerup selected, we go to Window > Animation > Animation.

Go to Window > Animation > Animation.

This will bring up the Animation frame below.

Animation Frame

Then we click create, which will bring up a window to name our animation. In this case, we’ll name it Shield_Powerup_anim. If you have not yet created a folder for your animations, do so now, it will save time later and keep things better organized.

We click the record button, which is a little reddish circle in the upper left of the Animation frame. Then we go into our Project frame and find the animation frames for the Shield. You click the first one, then while holding down the Shift key, select the last one. Then drag it over into the Animation frame as shown below.

Hit record and drop animation sprites into Animation frame.

Now you can hit record again to stop recording. You can then press the Play button to see the animation running in the Scene view.

Hit the Play button to dee the animation play in the Scene view.

Now select the Shield Powerup prefab in the Hierarchy and then in the Inspector, choose the dropdown for Overrides and select Apply All.

Make sure to apply the changes to the prefab in Overrides.

Now we can delete our Shield Powerup from the Hierarchy and play our game to see how the Shield Powerup looks while animated in-game.

See, the Shield Powerup is now fully animated.

Those are the basics for animating a sprite in Unity. There are more advanced options that we will cover in a later article. But this should be good to get you started. So until next time, I wish you good luck and success on your coding journey.

I'm a Unity developer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Construct Week Project || Dermstore Clone by using React-Redux

Onlife Got Out into the World!

My Open Source journey in LGM-SOC’21

How I Use Obsidian As A Creative — Part 3

Declaration of Homestead

PHP Web Patterns That Will Dominate By 2020

Time to Interactive with RUM

What To Choose AWS Or Azure For IaaS In 2021?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Brian Branch

Brian Branch

I'm a Unity developer.

More from Medium

Light layers in Unity HDRP

Platformer: Player Animation V — Idle Jump

Setting up a Unity Project for the High Definition Render Pipeline (HDRP)

Pushing Objects in Unity to Complete Puzzles