Q:

Grab and drop object

I'm trying new things and I'm stuck to find a way to drag and drop objects. My player is a square and he have a hand attached. Here is an example:

That red thing in the arm is the "hand", when I press shift it turns green. I made the detection like a ground check. Here is the code:
void Update () {
        touch = Physics2D.OverlapCircle(touchDetect.position, 0.01f, objectLayer);
        mao1.SetBool("Ligado", ligado);

        if (Input.GetKey(KeyCode.LeftShift)) {
            ligado = true;
        } else {
            ligado = false;
        }        
    }

The touchDetect is working fine, because he turns to "true" when touches the box: 

My question is: I don't know how to put in the script that I want him to grab the object and drop when I want to. If I need to use Raycast, how would the code looks like?

A:

In order to "grab" an object in unity, simply set the transform.parent of the gameobject you wish to grab, to the transform of the gameobject you wish to grab it with.  
For example, in your code you are using Physics2D.OverlapCircle which returns a Collider2D object.  You can use that collider to grab on to your gameobject.
Collider2D touch = Physics2D.OverlapCircle(touchDetect.position, 0.01f, objectLayer);

if (Input.GetKey(KeyCode.LeftShift) && touch != null) 
{
    //grab on to the object
    touch.gameObject.transform.parent = this.transform;

    //if your box has a rigidbody on it,and you want to take direct control of it
    //you will want to set the rigidbody iskinematic to true.
   GetComponent<Rigidbody2D>().isKinematic = true;
} 
else if( touch != null)
{
    //let the object go
    touch.gameObject.transform.parent = null;

    //if your object has a rigidbody be sure to turn kinematic back to false
    GetComponent<Rigidbody2D>().isKinematic = false;
} 

