How to set max rotation speed in 2d character that is following mouse cursor.

Hi. I wrote a simple script for my 2d topdown character to look in mouse direction.

here is my script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RotateToCursor : MonoBehaviour {
	Vector3 mousePos;
	Camera cam;
	Rigidbody2D rid;

	void Start () {
		rid = this.GetComponent<Rigidbody2D> ();
		cam = Camera.main;

	void Update () {
		rotateToCamera ();

	void rotateToCamera () {
		mousePos = cam.ScreenToWorldPoint (new Vector3 (Input.mousePosition.x, Input.mousePosition.y, Input.mousePosition.z - cam.transform.position.z));
		rid.transform.eulerAngles = new Vector3 (0, 0, Mathf.Atan2 ((mousePos.y - transform.position.y), (mousePos.x - transform.position.x)) * Mathf.Rad2Deg);

its okay but i want my character to rotate after mouse slower.
I dont want to change constant rotation speed but max rotation that character can perform.
I want it to be like that:
If i move cursor slowly he will follow it with normal rotation speed, but when i move cursor fast he will be limited to certain rotation speed and follow cursor in that max speed.

I tried everything to make it work but i cant manage to make it happen.
Can u guys give me at least a hint ? Maybe whole script is wrong and i should do it using Quaternion.LookRotation and Quaternion.RotateTowards ? Thanks in advance and sorry for my english.

I think the thing you area looking for is Vector3.Lerp:

You can use it like this:

//this script works if it is placed on the gameobject you want to rotate

//Get the vector between your character and the mouse
float x = Camera.main.ScreenPointToRay(Input.mousePosition).origin.x - gameObject.GetComponent<Transform>().position.x;
float y = Camera.main.ScreenPointToRay(Input.mousePosition).origin.y - gameObject.GetComponent<Transform>().position.y;
float z = 0;

//Calcualte the vector between your character and the mousePos as a unit vector:
Vector3 requestedDirection = new Vector3(x, y, z).normalized;

//Gradually moves the rotation of the gameobject t * 100 percent towards the requested direction on each call
gameobject.getComponent<Transform>().up = Vector3.Lerp(gameobject.getComponent<Transform>().up, requestedDirection, float t);