unity3d Unity Animation 2D Sprite Animation


Example

Sprite animation consists in showing an existing sequence of images or frames.

First import a sequence of images to the asset folder. Either create some images from scratch or download some from the Asset Store. (This example uses this free asset.)

animation sprites selected

Drag every individual image of a single animation from the assets folder to the scene view. Unity will show a dialog for naming the new animation clip.

animation clip name dialog

This is a useful shortcut for:

  • creating new game objects
  • assigning two components (a Sprite Renderer and an Animator)
  • creating animation controllers (and linking the new Animator component to them)
  • creating animation clips with the selected frames

the new game object inspector showing the new components

Preview the playback in the animation tab by clicking Play:

2d animation preview

The same method can be used to create new animations for the same game object, then deleting the new game object and animation controller. Add the new animation clip to the animation controller of that object in the same manner as with 3D animation.