Animating 2D objects in Unity (Game Dev Day 17)

Jack Leavey
2 min readJul 28, 2021

--

We have added our sprites to our various objects, but right now they don’t actually have any animations attached to them. We are going to add a Powerup system to our game to give it some more depth, so lets go ahead and animate the powerup pickups!

Fortunately Unity makes 2D animation importing a breeze. First, we drag our the first frame of the sprite animation, and use that to make our GameObject

We can rename this object to “Triple_Shot_Powerup”

Now we can see that this gameobject has a Sprite renderer applied with the first frame our the animation we are going to be making.

So next we will make the actual animation. Open up your Animation window in Unity (Look under the Window Tab at the top to find it).

The blank Animation tab.

Select the GameObject you want to animate in your Hierarchy. Your animation window will look like this.

Create your animation’s name and save location by clicking the “Create” button.

Next, grab the animation frames you want and select them all. Drag them from your Project Folder to the Animation Window.

Placing the animation into the animator

Now our object looks like this!

Simple animation!

--

--

Jack Leavey
Jack Leavey

Written by Jack Leavey

I am a software engineer with years of experience branching into game development, specifically in Unity. Follow along for guides on creating game mechanics!

No responses yet