Animating a sprite


  1. Create an animated sprite by clicking on "Create > tk2d > Sprite With Animator" in the Hierarchy Window.
    img/createspritewithanimator.png

  2. Select a default animation, and if necessary, tick the Play Automatically box to have the animation start playing as soon as the game starts. This is really convenient for looping background animations. In this example, select idle as the default animation.
    img/spriteanimatorinspector.png

NOTE: You can also animate any sprite type (clipped, tiled, etc.) by attaching a tk2dSpriteAnimator component to it. You can do this in the context menu of the sprite.
img/spritecontextmenu_animator.png