Angle goes from 180 to -180 instead of 0 to 360

So the angle goes from 180 to -180 and I want it to go from 0 to 360, but it just doesn’t want to cooperate and I don’t know what i am doing wrong.

IMAGE HERE
Imgur: The magic of the Internet .


Code in text:

    public GameObject m_Player;
    public GameObject m_PivotTarget;
    public GameObject m_BatTarget;

    public bool m_IsAttacking = false;

    float m_CurrentAngle = 0f;
    float m_PreviousAngle;
    float m_NewAngle = 0f;

    [SerializeField] float m_Smoothing;

    // Start is called before the first frame update
    void Start()
    {
        m_PreviousAngle = m_NewAngle;
    }

    // Update is called once per frame
    void Update()
    {
        Vector2 vector = Camera.main.ScreenToWorldPoint(Input.mousePosition) - m_Player.transform.position;
        
        float radiants = Mathf.Atan2(vector.y, vector.x);
        m_NewAngle = radiants * Mathf.Rad2Deg;

        m_CurrentAngle = Mathf.Lerp(m_PreviousAngle, m_NewAngle, Time.deltaTime * m_Smoothing);

        gameObject.transform.rotation = Quaternion.AngleAxis(m_CurrentAngle, Vector3.forward);

        m_PreviousAngle = m_CurrentAngle;
    }

its in the math… functions like mathf. dot product, cross product. atan all work in ± 180 degrees.
So your line Mathf.Atan2() is probably also returning ± result.
You can always add 180 to the result, to make it 0-360
Just use the debugger and put a breakpoint on that line 25… or use a temporary Debug.Log so you can see what is going on.