To create a frame-by-frame animation using a sprite sheet, follow these steps:
- Create a new Unity 2D project.
- Import the provided image; that is, monster1.
- With the monster1 image selected in the Project window, change its sprite mode to Multiple in the Inspector window. Then, click the Apply button at the bottom of the window:
Figure 6.39 – Setting for changing Sprite mode to Multiple
- In the Inspector window, open the Sprite Editor panel by clicking the Sprite Editor button.
- In Sprite Editor, open the Slice drop-down dialog. For Type, choose the Grid by CellSize drop-down option and set X and Y to 64. Click the Slice button, and then the Apply button in the bar at the top right of the Sprite Editor panel:
Figure 6.40 – Sprite Editor settings for splicing the sprite sheet
- In the Project window, you can now click the triangle button on the right-hand side of the sprite. You'll see...