OnTriggerEnter2D not working with boolean

public int MoveSize;
bool CantMoveDown = false;
bool Touching = false;

void Update () {

if (Input.GetKeyDown(KeyCode.DownArrow)){
        if (CantMoveDown = false) {
                 transform.position = new Vector2(transform.position.x, transform.position.y - MoveSize);
   	    if (Touching =  true){
    	     CantMoveDown = true;
    	     print ("Collided");	//Just for testing

	void OnTriggerEnter2D (Collider2D trigger){    
		Touching = true;
	void OnTriggerExit2D (Collider2D trigger){
		Touching = false;

This is part of my movement script. What is supposed to happen is if the sprite this script is attached to moves downwards and is adjacent to another sprite (With both ‘Is Trigger’ checked and a fitting collider), it should not be able to move downwards anymore until it doesn’t detect the sprite below.

Instead, I cannot move down at all and the console is printing “Collided”.
Am I using the OnTriggerEnter/Exit right? The script makes sense to me but is it incorrect?

Any help would be greatly appreciated! Thanks!

if(Touching = true) {
This is not a comparison, but an assignment.

The correct line would be

if(Touching == true) {

or, because == true can be omitted

if(Touching) {