void Update()
{
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
if(h>0)
print(Mathf.Abs(h));
Vector3 newVel = Rigidbody.velocity;
if (Mathf.Abs(h) > 0.01f || Mathf.Abs(v) > 0.01f)
{
print("444");
anim.SetBool("Move", true);
Rigidbody.velocity = new Vector3(velocity * h, newVel.y, velocity * v);
transform.LookAt(new Vector3(h, 0, v) + transform.position);
}
else
{
anim.SetBool("Move", false);
Rigidbody.velocity = new Vector3(0, newVel.y, 0);
}
}
如上代码段,输出结果为
而且切换的间隔我已经改的很短
为什么角色动画切换还有时间间隔?