Mouse X Input to control animation parameter is not smooth. C#

Hi I’m creating a 3rd person game and in my animator controller, I have a blend tree controlling if I’m walking forward, a little left, or a little right. The parameter I’m using is called Direction. The script that I’m using currently looks like this.

float RotSpeedX = 0f;
Animator anim;

void start
{
    anim=GetComponent<Animator>();
}

void update
{
    RotSpeedX=Input.GetAxis("Mouse X");
    anim.SetFloat("Direction", RotSpeedX);
}

This method plays the animation when I move the mouse, but it starts the animation without blending. The Axis Mouse X Goes from 0 to 1 and 0 to -1 in one frame, as if it were a bool with outputs as 0 and 1. Is there a way to use the mouses speed instead of rather its moving or not? Thnx. (:

use this,

RotSpeedX = 2 * Input.mousePosition.x / Screen.width - 1;