Script not working

I asked this a couple days ago, but still no luck… I have these cubes that have an animation coming down the screen. If you don’t press them in time (It’s a mobile game), then they hit the ground, which I have a invisible cube that has the trigger checked and a Script on it, and if the cubes hit the ground (on top of the trigger) The level would switch. the problem is that it’s not working, I’ve looked around everywhere, and can’t find the solution. Please Help!!!

import UnityEngine.SceneManagement;

function OnTriggerEnter (col : Collider) {

            Debug.Log(col.gameObject.name);
            if(col.gameObject.name == "Key");
            {
                
                SceneManagement.SceneManager.LoadScene("MainMenu");
              
            }
        }

Did you add rigidbody to one of them ?