Poster created a new question
Rotation of character resets when joystick is released
Hello! My problem is the following: I'm trying to create a top down 2d game. The character rotates and moves perfectly according to left stick input. However, whenever the left stick is released, the character seems to snap 0 rotation. where the character maintains it's direction when the joystick is released.
I am beginner so please give me full code.
here is my code now.
float heading = Mathf.Atan2(-joys.Horizontal, joys.vertical);
jdata = heading * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(0f,0f,jdata);
Please post your code, but basically just check if the input is not 0 before setting the rotation.
check now my code.
if you can solve it please help me. i also found a solution but i didn't know complete knowledge of c# thats why i didnt understand that. check it.
https://answers.unity.com/questions/422744/rotation-of-character-resets-when-joystick-is-rele.html
Since you posted a new question, I'll close this one and answer there.
Follow this Question
Related Questions
how create EndLess game Like zombie Tsunami 1 Answer
Why isn't my character moving? 2D C# Physics 2 Answers
How to merge a 2D Quiz with a 3D FPS? 0 Answers
2D Weird Jumping 1 Answer
Is it possible to add an Input Counter during Splash Screens? 0 Answers