I'm new and my scripts are wrong, please help

I was watching this video https://www.youtube.com/watch?v=QcScUGEvSoU&t=541s
And the EnemyManager doesn’t detect If there’s a enemy in the guns box collider, ive tried fixing it twice by redoing all the code but I somehow messed it up each time, here are the scripts.

EnemyManager scripts:

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

public class Enemymanager : MonoBehaviour
{
    public List<Enemy> EnemiesInTrigger = new List<Enemy>();

    public void AddEnemy (Enemy enemy)
    {
        EnemiesInTrigger.Add(enemy);
    }
    public void RemoveEnemy(Enemy enemy)
    {
        EnemiesInTrigger.Remove(enemy);
    }
}

gun scripts

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static UnityEngine.EventSystems.EventTrigger;

public class gun : MonoBehaviour
{

    public float range = 20;
    public float verticalrange = 20;

    private BoxCollider gunTrigger;

    public Enemymanager enemymanager;

    void Start()
    {
        gunTrigger = GetComponent<BoxCollider>();
        gunTrigger.size = new Vector3(x: 1, y: verticalrange, z: range);
        gunTrigger.center = new Vector3(x: 0, y: 0, z: range * 0.5f);
    }


    void Update()
    {

    }


    private void OnTriggerEnter(Collider other)
    {
        Enemy enemy = other.GetComponent<Enemy>();

        if (enemy)
        {
            enemymanager.AddEnemy(enemy);
        }
    }
    private void OnTriggerExit(Collider other)
    {
        {
            Enemy enemy = other.GetComponent<Enemy>();

            if (enemy)
            {
                enemymanager.RemoveEnemy(enemy);
            }
        }

    }


}

Enemy scripts

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

public class Enemy : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

If you can find my mistakes, please reply to this with them and how to fix them if you can, thanks.

So, the EnemyManager, seems to correctly only manage enemies, it ads and removes as per the list - now, note, it maybe in the list but it wont destroy/hide them, it just adds or removes them from a list in memory - a bit like if I said think of 2 numbers, i guess 1, and you remove it, only you know…

the gun has some form of trigger, and assumes what it triggered was an enemy, to an extent, I personally never had much like with somevar = getcomponent… if (somevar) … but it does seem to add them to the manager list and remove them on triggerexit

So, you say its not working.

Obvious potentials is

  1. every gun needs to be told where the enemymanager is, otherwise its a different list.
  2. the gun must actually be triggered - depending on size of collider, you may have to be super close

So, add debug messages, get your code to tell you where it went, what it found… this will guide you to looking at solving the issues.