How to Use the Force

I’m making a game with the force and i was wondering how i would make it so that when i hit shift, it grabs the object your pointing at, and while your holding shift and you move the mouse the object follows where your moving the mouse when you let go of shift, the object falls. i obviously have to put a rigid body on any object i want to pick up, but i don’t know how to do any thing else.

var pickupDistance = 3.0;
static var heldObject : GameObject;
static var itemHeld = 0;
var objectDist = -.1;
private var hand :GameObject;

function Start() {
    hand = gameObject.FindWithTag("Player");
}
 
function Update () {
    if (Input.GetMouseButtonDown(0) && itemHeld == 2) {
        hand.animation.Play("drop");
        heldObject.transform.parent = null;
        heldObject.GetComponent(Rigidbody).isKinematic = false;
        heldObject = null;
        itemHeld = 0;
    }
}
 
function OnMouseDown() {
    if(itemHeld == 0) {
        heldObject = gameObject;
        hand.animation.Play("grab");
        heldObject.transform.parent = gameObject.FindWithTag("Player").transform;
        heldObject.GetComponent(Rigidbody).isKinematic = true;
        var handLocation = Vector3(0,objectDist,0);
        heldObject.transform.localPosition = handLocation;
        itemHeld = 1;
    }
}
 
function OnMouseUp(){
    if(itemHeld == 1)
    {
      itemHeld = 2;
    }
}


not my code, but good solution.