To construct an animation that only plays once a Trigger has been received, follow these steps:
- In the Hierarchy, create an Empty GameObject named water-block-container, positioned at (2.5, -4, 0). This empty GameObject will allow us to make duplicates of animated Water Blocks that will animate relative to their parent GameObject position.
- Drag an instance of the Water Block sprite from the Project | Sprites folder into the scene and child it to the water-block-container GameObject. Ensure the position of your new child Water Block GameObject is (0, 0, 0), so that it appears neatly to right of the wall blocks platform:
- Add a Box Collider 2D component to the child Water Block GameObject, and set the layer of this GameObject ...