Q: Player stops move the character direction resets [Unity 2D] My character is a car and I try to rotate it the direction it move, so far so good I succeeded to do that but once I stop moving the character flips back to the direction it was on the start. 
Also how can I make my turns from side to the opposite site smooth ? 
Here is my code so far:
    [SerializeField] float driveSpeed = 5f;
 //state
 Rigidbody2D myRigidbody;
 // Start is called before the first frame update
 void Start()
 {
     myRigidbody = GetComponent<Rigidbody2D>();
 }
 // Update is called once per frame
 void Update()
 {
     Move();        
 }

 private void Move()
 {
     //Control of velocity of the car
     float HorizontalcontrolThrow = CrossPlatformInputManager.GetAxis("Horizontal"); // Value between -1 to 1
     float VerticalcontrolThrow = CrossPlatformInputManager.GetAxis("Vertical"); // Value between -1 to 1
     Vector2 playerVelocity = new Vector2(HorizontalcontrolThrow * driveSpeed, VerticalcontrolThrow * driveSpeed);
     myRigidbody.velocity =playerVelocity;


     **//Direction of the car**
     Vector2 direction = new Vector2(HorizontalcontrolThrow, VerticalcontrolThrow);
     float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
     myRigidbody.rotation = angle;
 }


A: I'm not sure about this, but maybe that last line "myRigidbody.rotation = angle" being called every frame is what is making your car reset its rotation.
Maybe change it to "myRigidbody.rotation *= angle" or "myRigidbody.rotation += angle".

A: It looks like it may be because HorizontalcontrolThrow and VerticalcontrolThrow are going to be reset when you release the controls. If it's resetting to its original orientation, then what's happening is that until you move, those two values are going to be at their default value. You then move and it affects the rotation. But when you release the controls, those values are back to the starting values again, and so is your rotation.
What you therefore need to do is try to separate the HorizontalcontrolThrow and VerticalcontrolThrow from the rest of the code, which should only be activated when at least one of these two variables are not at their default setting (I can't remember what the axis functions return at the moment).
Edit:
An IF statement should suffice (some rough pseudo code):
if (horizontalAxis != default || verticalAxis != default)
{
    Rotate/Move
}


A: I solved the snap rotation using Quaternion at rotation, the issiu I had with it was to convert it from 3d to 2d, through the guide of this clip: youtube.com/watch?v=mKLp-2iseDc and made my adjustments it works just fine  !
