This code should make the player rotate (he's on the XY plane) according to joystick movements.
Just straight up, what's wrong with this code? (not to be cliche or anything)
private void joystickMovementUpdate() {
direction = new Vector3(Input.GetAxis ("Right Joystick Horizontal"), Input.GetAxis ("Right Joystick Vertical"), 0);
horizontalAxis = Input.GetAxis ("Left Joystick Horizontal");
verticalAxis = Input.GetAxis ("Left Joystick Vertical");
if (direction.sqrMagnitude > 0.1f) {
qTo = Quaternion.LookRotation(direction);
qTo.eulerAngles = new Vector3(0, 180, qTo.eulerAngles.z);
}
transform.eulerAngles = new Vector3(0, 180, transform.eulerAngles.z);
transform.rotation = Quaternion.RotateTowards(transform.rotation, qTo, ROTATION_SPEED * Time.smoothDeltaTime);
move ();
}