I am having an issue i cannot seem to figure out within my code. What this code does at the moment is that it rotates the 3D Model around the z axis but i need it to rotate around the y axis. Any help would be greatly appreciated.
void Update () { Vector3 moveVector = (Vector3.up * joystick.Horizontal + Vector3.left * joystick.Vertical); if (joystick.Horizontal != 0 || joystick.Vertical != 0) { transform.rotation = Quaternion.LookRotation(Vector3.forward, moveVector); } }
Quaternion.LookRotation(moveVector, Vector3.up);? \$\endgroup\$moveVectorcan be parallel to the vertical axis at the moment. I'm not sure if they meant to multiplyjoystick.HorizontalbyVector3.forwardinstead ofVector3.up... \$\endgroup\$