Smooth ratation

Hello!
Ive got this code snipped witch causes the rotation of the player to its moving direction But its not smooth the player instent rotates. How can I make it a smoother rotation?

Vector2 v = GetComponent<Rigidbody2D>().velocity;
        float angle = Mathf.Atan2 (v.y, v.x) * Mathf.Rad2Deg;
        transform.rotation = Quaternion.AngleAxis (angle, Vector3.forward);

You mean like this:

void FixedUpdate() {
        Vector2 v = rb.velocity;
        float angle = Mathf.Atan2 (v.y, v.x) * Mathf.Rad2Deg * Time.fixedDeltaTime;
        transform.rotation = Quaternion.AngleAxis (angle, Vector3.forward);
    }

´This only causes that the rotation is not working anymore.

Maybe try this.

targetRotation = Quaternion.AngleAxis (angle, Vector3.forward);
 transform.rotation= Quaternion.Lerp (transform.rotation, targetRotation , smooth * Time.deltaTime);

or try rotateTowards.

I am ebut it does not rotate

void FixedUpdate() {
        Vector2 v = rb.velocity;
        float angle = Mathf.Atan2 (v.y, v.x) * Mathf.Rad2Deg * Time.fixedDeltaTime;
    //    transform.rotation = Quaternion.AngleAxis (angle, Vector3.forward);

        float smooth = 10f;
        Quaternion targetRotation = Quaternion.AngleAxis (angle, Vector3.forward);
        transform.rotation = Quaternion.Lerp (transform.rotation, targetRotation , smooth * Time.deltaTime);    
    
    }

Maybe it’s so slow you can’t see it rotate. Put the smooth as a public at the top and change it with the editor.
Also, you should be rotating the rigidbody, I think, if you are in fixed update using physics.