On Trigger Enter Not Executing?

Edit Thanks to the user KillerStarBunny I was able to figure out my problem, I just needed to add a rigid body to my “lightCollider” object and I was good to go. Thanks.

Hello,
I’m having an issue involving the “OnTriggerEnter” command. I have this code:

function OnTriggerEnter(collider : Collider)
{
    if(collider.tag == "lightCollider")
    {
	
	isAlerted = true;

	}   
}

This code is inside of a script attached to an object with a capsule collider with “IsTrigger” set to false. The tag “lightCollider” is found on an object that has a capsule collider with “IsTrigger” set to true.

My problem is that when the lightCollider object moves into the collider for the object holding the script, isAlerted does not change from false to true.

If this might help, here is the entire script including the snippet mentioned above:

var target : Transform;
var moveSpeed = 3;
var rotationSpeed = 3;
var myTransform : Transform;

var animation_crouchedIdle : String;
var animation_standUp : String;
var animation_moving : String;
var animation_attacking : String;

var you : Transform;
var thePlayer : Transform;
var dist : float = 10.0;

 var isAlerted : boolean = false;


function Awake()
{
	myTransform = transform;
}

function Start()
{
	
	target = GameObject.FindWithTag("Player").transform;
	
	for (var state : AnimationState in animation) {
    state.speed = 0.75;
} 

}

function OnTriggerEnter(collider : Collider)
{
    if(collider.tag == "lightCollider")
    {
	
	isAlerted = true;

	}
     
}

function Update()
{

if (isAlerted == true){

	GetComponent(NavMeshAgent).destination = target.position;
	transform.LookAt(Vector3(target.position.x, transform.position.y, target.position.z));
		   
      var distanceToDestroy = Vector3.Distance(thePlayer.position,you.position);


		   		   if (dist > distanceToDestroy){
        		animation.CrossFade(animation_attacking);
        
        }
        
        
            if (dist < distanceToDestroy){

        		animation.CrossFade(animation_moving);
        }
}

if (isAlerted == false){
        
animation.CrossFade(animation_crouchedIdle);

}

}

Please post actual answers and not just links to a webpage that might hold the answer. Thank you.

I figured it out! I needed to add a rigid body to my “lightCollider” object in order for it to execute the trigger object, thank you so much @KillerStarBunny .