Selecting which items can be picked up

I’ve been working on a coin pusher game where you can use the leap motion to drop the coins that you can spawn in. Only issue I’ve got with this is that I can pick up the coins that are already in play and I was wondering if there was any way to allow the magnetic hand prefab which I’m using to allow me to pick up items to only pick up items that are of a certain tag i.e. the coins which we as the player are using.

Many thanks!

Kirsty

What method are you using to pick up the items? I’m afraid the question is a little too vague without an explanation of your current implementation. =)

void Start()
{
    //If the tag of the object isnt pickup, disable rigidbody.
    if(gameObject.tag != "Pickup")
    {
        GetComponent<Rigidbody>().enabled = false;
    }
}

But you should really look into the code of picking up objects, and see when things happen.