- Home /
Animation direction based on character's direction
Hi guys. I have a basic 8 way animation, which is handled by "MoveX" and "MoveY" parameters of AnimatiorController.
anim.SetFloat("MoveX", CrossPlatformInputManager.GetAxis("Horizontal")); // Mobile stick pulled to right
anim.SetFloat("MoveY", CrossPlatformInputManager.GetAxis("Vertical")); //Mobile stick pulled upwards
but, when the character is rotated to different direction, MoveX and MoveY are still trying to animate as if the character is rotated to (0,0,0)
so what I want to have is, when the character is looking at right, and when the mobile stick is pulled to right, it should alter the MoveY value instead of MoveX value, so that moving forward animation can be played.
It was so hard to explain, I hope it was clear enough,
Thanks
Your answer
![](https://koobas.hobune.stream/wayback/20220612155551im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D Animation does not start 1 Answer
Reuse Animation directions 0 Answers
Damn, HOW CAN I KNOW, IF MY 2d ANIMATION SPRITE IS FINISHED??!! 0 Answers
Animation motion on base layer does not play after additional motion on second layer 0 Answers
Generic Animation Main Rig Doesn't Play Any Animation. 0 Answers