Problem using trigger to set gameobjects active

I know that this code should work and am wondering is it due to unitys update making gameObject.active = true; obsolite


var HQGood : GameObject;
var HQBad : GameObject;

    function OnTriggerEnter (other : Collider) {
      HQGood.SetActive(true);
        HQBad.SetActive (false);
       
    }
     
    function OnTriggerExit (other : Collider) {
        HQGood.SetActive(true);
        HQBad.SetActive (false);
           
    }

The answer was to flip the objects around. The trigger was on an inactive game object. If the game object is inactive, its triggers won’t register collisions.