my colliders arent being added to my list help

My colliders arent being added to a build script help

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class PreviewObject : MonoBehaviour
{


    public bool foundation;
    public List<Collider> col = new List<Collider>();
    public Material green;
    public Material red;
    public bool isBuildable;

    void OnTriggerEnter(Collider other)
    {

        if (other.gameObject.tag == "Buildable" && foundation)
        {

            col.Add(other);

            Debug.Log("AddedCol");

        }

        Debug.Log("test1");



    }


    void Update()
    {

        changecolor();

    }


    void OnTriggerExit(Collider other)
    {
        //(other.gameObject.layer == 9 && foundation)
        if (other.gameObject.tag == "Buildable" && foundation)
        {

            col.Remove(other);
        }

    }


    public void changecolor()
    {

        if (col.Count == 0)
            isBuildable = true;
        else
            isBuildable = false;

        if (isBuildable)
            foreach (Transform child in this.transform)
            {

                child.GetComponent<Renderer>().material = green;

            }
        else
        {

            foreach (Transform child in this.transform)
            {

                child.GetComponent<Renderer>().material = red;



            }




        }

    }

}

you can’t initialize list like that as far as I know

public List<Collider> col = new List<Collider>();

move this to Awake() or Start() like this :

public List<Collider> col;

void Start(){
   col = new List<Collider>();
}

Your "foundation’ bool defaults to false and as far as I can see, is not changed in this script so I will assume you’re setting it in the inspector? If so, ensure that when this collision happens, the bool is set to true.

nvm found the answer GG bois