1 of 24

Animation Overview

Game Development �Art for Games

2 of 24

Other Unity presentations

3 of 24

What is animation?

  • Animation is created by displaying slightly different still images in sequence so that objects appear to move over time.
  • Known as persistence of vision, this optical illusion occurs because rays of light from preceding images do not immediately leave the eye, thus creating an afterimage that blends each image with the next.
  • Post-it notes, films, and game engines all create this illusion, using a variety of frame rates and techniques, changing images or their properties, as new frames are drawn on screen.

4 of 24

Sprite Animation

a.k.a. "Frame by frame", "cel animation"

5 of 24

Frame-by-frame animation

  • Similarly, traditional or frame-by-frame animation creates motion by displaying images depicting slightly different poses in sequence.
  • This includes everything from “cel”* animations in old Disney films, claymation, to the animated GIFs and animations in video games.

Traditional animation techniques where characters are hand-drawn on transparent celluloid sheets (cels)

6 of 24

Frame-by-frame animation

  • In game development, frame-by-frame animation is usually referred to as sprite animation.
  • Like traditional animation, game engines display separate images in sequence to create motion.
  • Each image assumes a specific amount of change between the previous and next frames. Thus, this method is dependent on a specific frame rate (fps or frames per second).

Image: 8-bit game animation like Mega Man (1987) in Why Old Games Still Look Great

7 of 24

Frame-by-frame animation

  • In Unity, a frame-by-frame animation is also called a sprite animation.
  • Artists animate characters in an external application (Photoshop, After Effects, Animate, Procreate, etc.) and export the still frames as a png sequence or a sprite sheet to import into Unity.

8 of 24

Frame-by-frame animation pros / cons

Pros:

  • Animators work in the animation software of their choice

Cons:

  • You have to redraw each frame of the animation by hand.
  • Regardless how simple, each frame-by-frame animations require a frame for each state change.
  • You cannot blend sprite animation states. Animations for jump and shoot are all different.
  • More images are required for smoother transitions. Thus frame-by-frame animations may increase the size of your game and decrease performance, particularly on mobile. This is why pixel art is so common. Less pixels means less data required to store / display the frames.
  • More work is required to export animations from your external software into the game engine.

9 of 24

Timeline Animation

10 of 24

Timeline animation

  • In timeline animation, Animators store image properties in keyframes on a timeline.
  • While frame-by-frame requires a new image for each frame, with timeline animation, the software interpolates changes in (between) values over time.
  • This makes them easy to edit, control with scripts, or blend with other animations using Animator Controllers.
  • Timeline animations can be created in animation software (After Effects, Maya, Blender, etc.) and imported, or created directly in Unity.

11 of 24

Timeline animation: Character Rigs

  • The ability to animate any property makes the timeline popular for animating character rigs.
  • Reusing the character's moving parts in a puppet animation enables potentially hundreds of new clips with no performance hit.

1) Prepare body parts in Photoshop;�2) Save to a single PSD;�3) Import the file to Unity + reassemble;

4) Create idle, walk, and run animations on the timeline �5) Control the animation that is displayed using the Animator "state machine"

12 of 24

Skeletal Rigs

13 of 24

Timeline animation: Skeletal rigs

  • Character rigs commonly use a bone structure, allowing creators to merge timeline animations with physics simulations.
  • Whether the animator works directly in Unity, or imports animation files from Maya, Blender, or other modeling or animation tool, these skeletal animations are the type most commonly encountered across the game and film industries.

14 of 24

15 of 24

Timeline animation: Skeletal rigs

16 of 24

17 of 24

Blend shapes and mesh deformation

Mesh deformation is like skeletal animation in that it maps images onto animated structures.

18 of 24

Scripted

Using user input

19 of 24

Scripted animation

  • In scripted animation the properties (position, rotation, etc.) of objects are controlled entirely by code using dynamic variables.
  • For example, input from a game controller, or other variables in the game changes a character’s position in a game world.

20 of 24

Physics-based

21 of 24

Scripted animation: Physics-based

  • In physics-based procedural animation, objects change position to simulate real world physics.
  • In this type, the game engine uses theoretical laws of physics (like rigid body dynamics) to perform numerical computations to determine how gravity and other forces will act on game objects on each frame.

22 of 24

Physics-based

23 of 24

All of the above!

Puppet rig + face/hands swapped as needed

Skeletal + Scripted + Physics

Skeletal + Physics

Skeletal + Scripted (via MoCap)

Frame by frame + gravity

Frame by frame (n+cameras!) + gravity

Green screen + timeline

Skeletal + Scripted (via MoCap)

24 of 24

Next steps