To flip an object horizontally using Animator State Chart and Transitions, follow these steps:
- Create a new Unity 2D project.
- Import the provided image: EnemyBug.png.
- Drag an instance of the red Enemy Bug image from the Project | Sprites folder into the scene. Position this GameObject at (0, 0, 0) and scale to (2, 2, 2).
- With the Enemy Bug GameObject selected in Hierarchy, open the Animation panel (menu: Window | Animation | Animation), and click the Create button to create a new Animation Clip asset. Save the new Animation Clip asset as beetle-right. You will also see that an Animator component has been added to the Enemy Bug GameObject:
- If you look at the Project panel, you'll see two new asset files have been created: ...