Answers for "How can I rotate my player to look at the direction my Joystick is pointing to? (Top-Down 2D)"
http://answers.unity.com/questions/816119/top-down-2d-how-can-i-rotate-my-player-to-look-at.html
The latest answers for the question "How can I rotate my player to look at the direction my Joystick is pointing to? (Top-Down 2D)"Answer by KingKong320
http://answers.unity.com/answers/1496479/view.html
if (moveVec.sqrMagnitude > 0.1) {
angle = Mathf.Atan2 (moveVec.x, moveVec.y) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Lerp (transform.rotation, Quaternion.Euler (new Vector3 (0, 0, -angle)), Time.deltaTime * rotationSpeed);
}Fri, 20 Apr 2018 04:18:59 GMTKingKong320Answer by InvisionaryUK
http://answers.unity.com/answers/1496093/view.html
@meticodetest Just use interpolation between angles this should smooth it out for you. il get an example up as soon as i canThu, 19 Apr 2018 11:15:11 GMTInvisionaryUKAnswer by Itaros
http://answers.unity.com/answers/816173/view.html
Take the vector at which joystick is pointed and use math to get heading:
float heading = Mathf.Atan2(joyvector.x,joyvector.y);
It is heading in radians which can be used to point the object in right direction like:
transform.rotation=Quaternion.Euler(0f,0f,heading*Mathf.Rad2Deg);Fri, 24 Oct 2014 06:44:45 GMTItaros