Setting Draggable Limits for a game object?

Hi guys!
I am having a hard time trying to figure out how to limit the gameObject dragging area. The code below will begin to drag a game object once you click on it but how do i apply dragging limits… like a radius limit zone! so one will not be able to drag it passed that zone… hope this make sense… Example: ball is sitting on the middle of the screen you click and drag it way from the center but once you drag it passed a certain point the ball stops following your mouse, then if you get back into the dragging zone it picks up and continues to follow your mouse…

if(Input.GetMouseButtonDown(0) )) 
	{
		var hit : RaycastHit;
		var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
		
		
		if (!Physics.Raycast (ray, hit, 10000))
			return;


		if(hit.transform.gameObject.tag == "ball")
		{
			focusObj = hit.transform.gameObject;  // focusObj is set as a GameObject var
			
		}
	}

You could just create a trigger, (sphere or any shape). Have this trigger be able to talk to your drag player script. If player exits the trigger, cancel the ability to drag and reset the player pos inside the limits boundaries.

When you start dragging then save the current position of the dragged object to a variable. Then simply check when the distance or a value between the savedPosition and the currentPosition is.

The solution from renman would cause less controls as it just gets fired when the object leaves the triggerArea (collider for example)

Thank you! I just needed a little push towards a solid solution… i shall try both…