To animate body parts for character movement events, follow these steps:
- Create a new Unity 2D project.
- Import the provided PotatoManAssets package into your project.
- Increase the size of Main Camera to 10.
- Set up the 2D gravity setting for this project – we'll use the same setting that's provided in Unity's 2D platform tutorial – that is, a setting of Y= -30. Set 2D gravity to this value by going to Edit | Project Settings | Physics 2D and changing the Y value to -30:
Figure 6.15 – Setting up 2D gravity for this project
- Drag an instance of the PotatoMan hero character from the Project | Prefabs folder into the scene. Position this GameObject at (0, 3, 0).
- Drag an instance of the platformWallBlocks sprite from the Project | Sprites folder into the scene. Position this GameObject at (0, -4, 0).
- Add a Box Collider 2D component to the platformWallBlocks GameObject by going...