Make object face the direction it is moving when using a mouse for movement.

I have seen many other threads pertaining to this issue ,but the answer doesn’t seem to be working for me. Also, I’m using a mouse to make my player travel towards the mouse. How do I make it so that it is always looking in the direction of the motion. Here is my code for the mouse motion.

private Vector3 mousePosition;
	public float moveSpeed = 0.1f;
	
	void Start () {
		Screen.showCursor = false;
		}
		
	void Update () {
		
		if (Input.GetMouseButton(0)) {
			
			mousePosition = Input.mousePosition;
			
			mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);
			
			transform.position = Vector2.Lerp(transform.position, mousePosition, moveSpeed);

		}
	}

Try this:

Vector3 dir = mousePosition - transform.position;
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.AngleAxis(angle+90.0f, Vector3.forward);