MouseDrag() stops working

I have the following piece of code attached to a cylinder, and it works fine, but every time I run it for some time (a matter of seconds), the On MouseDrag() stops working, not detecting my dragging. Any clues?

static var strength : float; 
static var oldMouse: float; 

    
   function OnMouseDown() { 
    
   oldMouse = Input.mousePosition.y; 
      
   } 
      
   function OnMouseDrag(){ 
          
   transform.Rotate( Vector3(strength,0,0) * Time.deltaTime ); 
  
} 
function Update () { 
    
   strength = (Input.mousePosition.y - oldMouse); 



}

Thanks a lot!

Does the dragging stop when the mouse moves off the object with the script?

I just encountered the same problem. but I’ve not handled the mouse moving off the obj, I’ll try and report here…