!!!!!!!!!!!!!!!!!!!!!
For mobile inputs use this:
private void FixedUpdate() {
Vector2 dir = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")); //Custom Input
if (Mathf.Abs(dir.y) == 1) {
animator.SetInteger("Direction", dir.y > 0 ? 1 : 0);
} else if(Mathf.Abs(dir.x) == 1) {
animator.SetInteger("Direction", dir.x > 0 ? 2 : 3);
}
dir.Normalize();
animator.SetBool("IsMoving", dir.magnitude > 0);
rb.velocity = speed * dir;
}
😎👌