Creating a three-frame animation clip to make a platform continually animate
In this recipe, we’ll make a wooden-looking platform continually animate, moving upward and downward. This can be achieved with a single three-frame Animation Clip (starting at the top, then positioned at the bottom, and finally back at the top position). Note that each frame is a static position and that we will employ the animation technique known as in-betweening to create the necessary movement:
Figure 8.29: Example of a moving platform game
Getting ready
This recipe builds on the previous one, so make a copy of that project and work on the copy for this recipe.
How to do it...
To create a continually moving animated platform, follow these steps:
- Drag an instance of the
platformWoodBlocks
sprite from the Project | Sprites folder into the scene. Position this GameObject at(-4, -5, 0)
so that these wood blocks are neatly to the left and slightly below the wall...