- Home /
Sidescroller animation - flipping from right to left efficiently in mechanim
I am animating a character for a sidescroller. Is there any more efficient way to flip right animations to left than by creating a separate animation clip that has Root Transform Rotation offset by 180 degrees?
While rather straightforward, it requires me to duplicate my work, any time when I want to add another animation state.
Comment
Answer by Finijumper · Mar 03, 2017 at 07:57 PM
You can change the X scale from 1 to -1. To achieve this you can use this.gameObject.transform.localScale.x property.
Or you can rotate the sprite
transform.eulerAngles = new Vector3(0, 0, 0); // Normal
transform.eulerAngles = new Vector3(0, 180, 0); // Flipped
Your answer