Skip to main content
added 24 characters in body
Source Link

var x = Input.GetAxisRaw("Horizontal"); var z = Input.GetAxisRaw("Vertical"); moveDir = new Vector3(x, 0, z).normalized; Vector3 animationVector = transform.InverseTransformVector(moveDir); anim.SetFloat("moveX", animationVector.x); anim.SetFloat("moveZ", animationVector.z);

var x = Input.GetAxisRaw("Horizontal");
var z = Input.GetAxisRaw("Vertical");
moveDir = new Vector3(x, 0, z).normalized;
Vector3 animationVector = transform.InverseTransformVector(moveDir);
anim.SetFloat("moveX", animationVector.x);
anim.SetFloat("moveZ", animationVector.z);

var x = Input.GetAxisRaw("Horizontal"); var z = Input.GetAxisRaw("Vertical"); moveDir = new Vector3(x, 0, z).normalized; Vector3 animationVector = transform.InverseTransformVector(moveDir); anim.SetFloat("moveX", animationVector.x); anim.SetFloat("moveZ", animationVector.z);

var x = Input.GetAxisRaw("Horizontal");
var z = Input.GetAxisRaw("Vertical");
moveDir = new Vector3(x, 0, z).normalized;
Vector3 animationVector = transform.InverseTransformVector(moveDir);
anim.SetFloat("moveX", animationVector.x);
anim.SetFloat("moveZ", animationVector.z);
Source Link

var x = Input.GetAxisRaw("Horizontal"); var z = Input.GetAxisRaw("Vertical"); moveDir = new Vector3(x, 0, z).normalized; Vector3 animationVector = transform.InverseTransformVector(moveDir); anim.SetFloat("moveX", animationVector.x); anim.SetFloat("moveZ", animationVector.z);