C# Rotating object based on movement direction

I’m trying to finalize the coding for how characters will move and react with the camera. Currently, it moves depending on the directions the Camera is facing. (Code is provided for explanation) I’ve been searching around and could never find a solid answer on how to get the object to rotate and face the direction it is moving in since the object’s rotation doesn’t affect the direction it is moving in. Rotating the object is just so characters will face the direction they are moving. (Rotation is a long the Y axis based on movement of the X and Z axis.) I tried using Quaternion.LookRotation(rigidbody.velocity) but a few issues arise from that.

  1. When changing movement direction, the character will instantly turn to the targeted direction. It isn’t a gradual rotation change in which how a character would realistically turn.
  2. When you stop moving or turning the character won’t stay in the last position it was in. It will change its rotation back to normal rather than when the character stops moving the rotation stays as is. Also not moving will spam the console log saying the vector is currently 0.

Any tips, answers, or guidance towards is thanked in advance. Here is the code.

	void Update () 
	{
		if (!IsDead)
		{
			Vector3 forward = Camera.main.transform.TransformDirection(Vector3.forward);
			forward.y = 0;
			forward = forward.normalized;
			Vector3 right = new Vector3(forward.z,0,-forward.x);
			MovementDirection = (Input.GetAxis("Horizontal") * right + Input.GetAxis("Vertical") * forward)* WalkSpeed;
			transform.rigidbody.velocity = new Vector3(MovementDirection.x,rigidbody.velocity.y,MovementDirection.z);
			if (Input.GetMouseButton(1))
			{	//ignore this. Old rotation code not being used.
				//transform.rotation = Quaternion.Euler(0,Mathf.LerpAngle(transform.rotation.eulerAngles.y,Camera.main.transform.eulerAngles.y,RotateDampening * Time.deltaTime),0);

			}
			else
			{

			}
		}

	}

This has been resolved. This is how it was handled.

if (transform.rigidbody.velocity != Vector3.zero)
			{
				transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.LookRotation(new Vector3(transform.rigidbody.velocity.x,0,transform.rigidbody.velocity.z)), Time.deltaTime * RotateSpeed);
			}