edit isTrigger by clicking on it,

hi i’m trying to make a isTrigger to true when clicking on the object and when is not holding set isTrigeer to false (i’m trying to make it for a drag and drop script so that it cannot push and throw the player) this is the script and it cant seem to work (i just started so don’t judge)

 public GameObject blocc;
    // Use this for initialization
    void Start()
    {
        if (Input.GetMouseButtonDown(0))
            blocc.GetComponent<BoxCollider2D>().isTrigger = true;


    }

try this:

blocc.GetComponent<Collider2D>().isTrigger= Input.GetMouseButtonDown(0);