public void FixedUpdate() { var direction = _joystick.Direction; if (_state.Move(direction)) { var dir = new Vector3(direction.x, 0, direction.y); _rigidbody.velocity = dir * _speed; transform.LookAt(transform.position + dir); } }