// This will make hte player drop the object
    void Drop()
    {
        bool canDrop = true;         // Whether the object can be dropped

        // Check through everything the object is touching
        foreach (Collider2D collider in touching)
        {
            // Check if the collider still exists and that it doesn't allow objects to be dropped on it
            if (collider != null && collider.gameObject.tag == "No Drop")
            {
                canDrop = false;       // Tell the object that it can't be dropped
                break;                 // No need to check if anything else is blocking the object
            }
        }

        // Check if the object can be dropped
        if (canDrop)
        {
            // Check to see if the player is holding this object
            if (currentlyHolding != null && currentlyHolding == this)
            {
                currentlyHolding = null;  // Tell the class that the player is no longer holding anything
            }
            pickedUp         = false;     // Drop the object
            gameObject.layer = 0;         // Reset the layer
            Destroy(GetComponent <Rigidbody2D>());

            // Check to see if the object can't be picked up again
            if (!canPickup)
            {
                Destroy(this);                 // If the object can't be picked up again, there is no need for this script to be attached
            }
        }
    }
    // This will make the player pick up the object
    public void PickUp()
    {
        lastPickup = Time.time;
        // Check if the player is already holding something
        if (currentlyHolding != null)
        {
            currentlyHolding.Drop();                                       // Drop the object the player is already holding
        }
        currentlyHolding = this;                                           // Tell the class this is the object being held
        pickedUp         = true;                                           // Pick up the object
        gameObject.layer = 2;                                              // Make it so OnMouseDown wont trigger
        Rigidbody2D rb = gameObject.AddComponent <Rigidbody2D>();          // Add a rigidbody

        rb.constraints            = RigidbodyConstraints2D.FreezeRotation; // Unfreeze the position of the object, but freeze the rotation
        rb.collisionDetectionMode = CollisionDetectionMode2D.Continuous;   // Ensuring continuous collision detection ensures players wont glitch it out of the map
    }