- Home /
Player rotating in direction of joystick doesn't work, why?,Rotate Player in direction of Joystick has too little impact
I tried to let my player face the direction my (touch)joystick is facing by this:
("handle" is my joystick)
float directionAngle = Mathf.Atan2(handle.transform.position.x, handle.transform.position.y) * Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(0f, directionAngle, 0f);
However, my player just rotates about 10 degrees (on the y-axis, as intended) between 70º and 80º.
Does anyone have a solution to that? The Player should rotate directly in the direction my joystick is facing.
Comment