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 blocks platform.
- Add a Box Collider 2D component to the platformWoodBlocks GameObject so that the player's character can stand on this platform too. To do this, go to Add Component | Physics 2D | Box Collider 2D.
- Create a new folder named Animations to store the controller and Animation Clip we'll create next.
- Ensuring the platformWoodBlocks GameObject is still selected in the Hierarchy window, open an Animation window and ensure it is in Dope Sheet view (this is the default).
- Click the Animation window's Create button and save the new clip in your new Animation folder, naming it platform-wood...