#Can't Mirror my animations.

8 messages · Page 1 of 1 (latest)

violet nimbus
#

My charcater has left, up, down, up left and down left animation clips which i have used in blend tree. I also want my character to move in right, up right and down right direction. But instead of running, it slides in right direction.
My character is a 2d sprite, so i cant use blend tree mirror animation. I tried using Sprite renderer's flip X. Used the script for flipping but it not working for me.
The sr.flipX script was working when i was only moving it in X and Y direction. But now i have added other directions, its not working.

And when I used this for flipping. The sprite is flipped only. But i also want the animation clip to be mirrored in other direction.
if (moveHorizontal != 0 || moveVertical != 0)
{
float direction = Mathf.Sign(moveHorizontal);
transform.localScale = new Vector2(direction, 1f);
}

Maybe flip is not the right word, I want my animations from left direction to be flipped in right direction when i move my character to right side

empty stream
#

The code should work, this looks more like an animator issue to me.

violet nimbus
empty stream
#

When you walk to the right, it seems that the character gets stuck in the default state of your move blend tree, instead of contiuing to play the walk animation.
This wouldn't be caused by scaling or flipping the renderer.

violet nimbus
#

so its actually running while moving left but still not flipping in that direction. Please ignore that double character, idk it just magically appeared out of nowhere lol

empty stream
#

Maybe show your animator setup & the corresponding code

empty stream
#

That code does not control your animations. And you'll need to show the setup of the state(s) and transition(s) actually relevant to the walk animation.