2D角色,未访问左侧动画 [英] 2D Character, left animation is not being accessed
本文介绍了2D角色,未访问左侧动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在2D角色动画中遇到问题。我只是简单地使它的动画左右移动。我在动画器中进行设置,由于某种原因,正在访问正确的动画,但是每当我按 A时都不会访问左边的动画。
这是我的PlayerController脚本动画的代码部分:
I have issue in Unity with my 2D characters animation. I simply made the animation of it walking right and left. I set things up in the animator, and for some reason the right animation is being accessed, but not the left whenever I press "A". This is the code part of animation of my PlayerController script:
anim.SetFloat("mSpeed", Mathf.Abs(rb.velocity.x));
推荐答案
弄清楚该怎么做而不是使用左动画,我只是在按下 A键时将Sprite Render用于Flip.X。而且有效!
Figured out what to do instead of using left animation, I just used the Sprite Render to Flip.X when the "A" key is pressed. And it works!
这篇关于2D角色,未访问左侧动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文