SPRITE ANIMATION: SPRITESHEETS

Walk frames, spritesheets, and alien characters for animation

Lesson 11 Animation — Spritesheets Unity 2D — Year 9 Kenney Assets
1
Option A: Base Pack Walk Frames (EASIER)
Individual walk frame images — simplest approach

This is the easiest approach to sprite animation in Unity. The Kenney base pack provides each animation frame as a separate image file. You simply select all the frames, drag them onto your character, and Unity creates the animation for you automatically. No slicing or configuration needed.

Player 1 Animation Files

Location: Base pack/Player/

FileDescription
p1_stand.pngIdle pose (single frame)
p1_walk/ folder11 walk frames (p1_walk01.png to p1_walk11.png)
p1_jump.pngJump pose (single frame)
p1_duck.pngCrouch pose (single frame)
p1_hurt.pngDamage pose (single frame)
💡 The same files exist for p2_ and p3_ prefixes. You can use any of the three player characters — they all have the same animation set with different appearances.

Create Walk Animation

  1. Import the ENTIRE p1_walk/ folder into Assets/Sprites/Player/ in your Unity project
  2. In Unity, select ALL walk frames — click p1_walk01, then hold Shift and click p1_walk11 to select all 11 frames
  3. Drag them ALL onto the Player GameObject in the Hierarchy panel
  4. A Save dialog appears — save the animation as "Player_Walk" in an Assets/Animations/ folder (create it if needed)
  5. Unity auto-creates an Animation Clip + Animator Controller for you
  6. Open the Animation window: Window → Animation → Animation
  7. Change Samples to 12 for smooth pixel art animation speed

Create Idle Animation

  1. Select ONLY p1_stand.png in the Project panel
  2. Drag it onto the Player GameObject in the Hierarchy
  3. Save the animation as "Player_Idle"

Create Jump Animation

  1. Select p1_jump.png, drag it onto the Player, and save as "Player_Jump"
💡 You can repeat the same process for p1_duck.png (crouch) and p1_hurt.png (damage) to build a complete animation set. Each single-frame image becomes a one-frame animation clip.
2
Option B: Base Pack Spritesheet (MORE ADVANCED)
All frames packed into a single image — requires slicing

For students who want to try the spritesheet approach, the Kenney base pack also includes all animation frames packed into a single image. This is more advanced but is how professional games typically handle sprites.

Spritesheet Files

FileLocationDescription
p1_spritesheet.pngBase pack/Player/All frames in one image
p1_spritesheet.txtBase pack/Player/Frame size/position data

Slice the Spritesheet

  1. Import p1_spritesheet.png into your Unity project
  2. Select it, then in the Inspector change Sprite Mode to Multiple
  3. Click the Sprite Editor button
  4. In the Sprite Editor, click Slice → set Type to Grid By Cell Size → enter 72 x 97 pixels
  5. Click the Slice button, then Apply at the top, then close the editor
  6. Expand the spritesheet in the Project panel — you will see all the individual frames appear as child sprites
  7. Select the walk frames from the expanded list, then drag them onto the Player in the Hierarchy to create the animation
⚠️ The spritesheet approach is trickier because you need to figure out the correct cell size. If frames look wrong (cut off or overlapping), try different pixel sizes. The .txt file included alongside the spritesheet has the exact pixel coordinates for each frame — open it in a text editor to check.
3
Option C: Alien Characters (RECOMMENDED — Most Animations!)
Full animation set with climb & swim states

The Kenney alien character sprites are the recommended choice for animation because they come with the most animation states. Each alien colour has individual frame images that are easy to work with (like Option A) plus bonus climb and swim animations.

Location: Extra animations and enemies/Alien sprites/

5 Colours Available

BeigeBlueGreenPinkYellow

Full Animation Set (alienBeige example)

FileDescription
alienBeige_stand.pngIdle pose
alienBeige_walk1.pngWalk frame 1
alienBeige_walk2.pngWalk frame 2
alienBeige_jump.pngJump pose
alienBeige_duck.pngCrouch pose
alienBeige_hurt.pngDamage pose
alienBeige_climb1.pngClimbing frame 1
alienBeige_climb2.pngClimbing frame 2
alienBeige_swim1.pngSwimming frame 1
alienBeige_swim2.pngSwimming frame 2
The alien characters have MORE animation states (climb, swim) than the base players. Great for games with ladders or water! Replace "Beige" with Blue, Green, Pink, or Yellow for other colours — the file naming pattern is identical.

Pre-Made Spritesheets Also Available

If you prefer the spritesheet workflow (Option B style), pre-made spritesheets for each alien are located at:

Extra animations and enemies/Spritesheets/alienBeige.png

Each spritesheet comes with a matching .xml file containing the exact slice data for each frame.

4
Animator Controller Setup
State machine, parameters & transitions

After creating your animation clips, you need to set up the Animator Controller to switch between them. The Animator uses a state machine — each animation is a "state", and you define rules (transitions) for when to change states.

State Machine Diagram

┌─────────────┐ Speed>0.1 │ Player_Walk │ Speed<0.1 ┌──────────────►│ │◄──────────────┐ │ └─────────────┘ │ ┌───┴─────────┐ ┌────────┴────┐ │ Player_Idle │◄─── Any State ─────────│ Player_Jump │ │ (Default) │ IsJumping=true │ │ └─────────────┘ └─────────────┘ IsJumping=false

Animator Parameters to Create

ParameterTypePurpose
SpeedFloat0 = idle, >0.1 = walking/running
IsJumpingBooltrue when the player is airborne

Setting Up Transitions

  1. Open the Animator window: Window → Animation → Animator
  2. Right-click Player_IdleMake Transition → click on Player_Walk
  3. Select the transition arrow. In the Inspector, uncheck "Has Exit Time"
  4. Set Transition Duration to 0 (instant switch, no blending)
  5. Under Conditions, click + → set Speed / Greater / 0.1
  6. Create the reverse transition: Player_Walk → Player_Idle with condition Speed / Less / 0.1
  7. For jumping: right-click Any StateMake TransitionPlayer_Jump with condition IsJumping = true
  8. Transition from Player_Jump → Player_Idle with condition IsJumping = false
⚠️ Always uncheck "Has Exit Time" and set Transition Duration to 0 for every transition. If you forget, your animations will feel sluggish and delayed — the character will finish the old animation before switching.
💡 The Parameters tab is on the left side of the Animator window. Click the + button to add new Float or Bool parameters. These are the values your movement script will control at runtime.
5
Enemy Animation Frames
Extension challenge — animate enemies too

For an extension challenge, you can animate enemies using the same drag-and-drop method you learned for the player character. Each enemy has individual frame images for different states.

Location: Extra animations and enemies/Enemy sprites/

Enemy Sprite Files

EnemyIdleMoveDeadHit
Slimeslime.pngslime_walk.pngslime_dead.pngslime_hit.png
Batbat.pngbat_fly.pngbat_dead.pngbat_hit.png
Beebee.pngbee_fly.pngbee_dead.pngbee_hit.png
Spiderspider.pngspider_walk1/2.pngspider_dead.pngspider_hit.png
Snakesnake.pngsnake_walk.pngsnake_dead.pngsnake_hit.png
Ghostghost.pngghost_normal.pngghost_dead.pngghost_hit.png
💡 Use the same workflow as the player: select the frames for one animation state, drag them onto the enemy GameObject, and save the clip. Create an Animator Controller for each enemy type with Idle, Move, Dead, and Hit states.
The Spider has two walk frames (spider_walk1.png and spider_walk2.png) for a more detailed crawling animation. All other enemies use single-frame movement states, which still work well for simple 2D games.