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!