How can i set AddRelativeForce relative to how fast/slow im moving my mouse?

Hi, I want to open a door by dragging with my code. The door retains a constant velocity though no matter how fast or slow i drag my mouse. Is there someway to set the force relative to my mouse speed? Thanks!

function Update()
{
	onMouseDrag();
}

function onMouseDrag()
{
	if(Input.GetMouseButton(0))
	{
		rigidbody.drag = 0;
		if(Input.GetAxis("Mouse X")>0)
		{
			rigidbody.AddRelativeForce (Vector3.forward * 1);
		}
		
		if(Input.GetAxis("Mouse X")<0)
		{
			rigidbody.AddRelativeForce (Vector3.back * 1);
		}
	}
	else
	{
		rigidbody.drag = 3;
	}
}

Probably better to do this through joint. Short concept:

  1. Add to haracter for example hinge joint component.
  2. Set by script “connected body” of joint to your door rigidbody.
  3. Enable joint connection while pressing mouse button and you have physic interaction with door.

Sorry silly question, i just fiddles with the values of Drag and the multiplying vector and got the effect i was looking for. Nothing wrong in the code.