Just making a simple button to make my player rotate when you press a button(on the canvas not the keyboard). So I made this function:
public void Rotate() { transform.rotation = Quaternion.Euler(transform.rotation.x, transform.rotation.y - 90, transform.rotation.z); }
and connected it to my button.
but every time I press the button, it doesn't turn -90 dergrees but it rotates to a strange rotation like 0, -88.6758, 0 and if I press it again it doesn't turn! pls help!