Creating a Sprite Animation


This tutorial will show you how to create a Sprite Animation. We will be using some additional sprites for this example which aren't distributed with the toolkit. You can download these sprites from here. These sprites are from SpriteLib.

  1. Extract the textures into your Unity project workspace. We put ours in /Assets/Walkthrough/animation/sprites.

    img/spritesinproject190.png

  2. Create a sprite collection and add all these sprites to the collection. The newly added sprites will all be selected. Before you click Commit, set the Anchor to LowerLeft and click apply - this will set all the anchors on all newly created sprites to the lower left.

    img/spritesetup190.png

  3. Click commit on the sprite collection. This is the sprite collection set-up done.

    img/spritescommit190.png

  4. We will now proceed to create the Sprite Animation. Create it in the collection by selecting "Create > tk2d > Sprite Animation" in the Project Window. Name it CharacterAnims.

    img/createspriteanimation190.png

  5. Select the newly created sprite animation in the project window, and open the sprite animation editor by clicking Open Editor.

    img/openspriteanimeditor190.png

  6. Click "Create > Clip" in the sprite animation editor. This will create a new clip which you can edit.

    img/addclip190.png

  7. Name the newly created clip "idle". Set up the window as shown below.

    img/idleclip190.png

  8. Create a new clip and name it "walk". Select the first frame (walk1) and click AutoFill1..9. All the rest of the frames will be automatically added. Autofill1..9 finds frames numbered sequentially from the currently selected frame.

    img/walkclip190.png

  9. Add another clip and call it "hit". Add the first frame of the clip (hit1) and click AutoFill1..9 to fill the rest of the frames.

    img/hitclip190.png