Can't turn on script of other game objects, please help

var linkedLight : Light;  //the light that SHOULD turn on when Red Barrels collision is detected
var aimLight: GameObject; //the game object the light is attached to that aims the light at the Barrel as it rolls

function OnTriggerEnter (other:Collider) {
	if (name == "RedBarrel") {
    linkedLight.enabled = !linkedLight.enabled;
    aimLight.GetComponent(smoothLookAtConstraint).enabled = true;
	}
}

THE PROBLEM: The light doesn’t come on AND the smoothLookAtConstraint script doesn’t get enabled When the barrel rolls through the collider

The exposed variables linkedLight and aimlight have their correct objects attached to them in the scene, through the inspector.

There is a box collider in the scene that is a trigger that I am rolling barrels through. The Script above is attached to it.
When they come in the collision area, I want the light to turn on and start aiming at the barrel until it is no longer inside.
I have gone through so many other scripts on here and can’t get it to work.

My error now with this code tells me Unknown identifier: ‘smoothLookAtConstraint’.
From what I’ve read, using GetComponent allows me to access scripts within a gameobject.But i guess not?

This is the code I have so far.
Any help would be appreciated, gonna pull out the little bit of hair I have

Your if compares name of the current object to “RedBerrel”, not sure if this is the behavior you want or you want to test the name of the collider:

...
if (other.name == "RedBarrel") {
...

I want to test the name of the RedBarrel because there will be different color barrels going through, making different things happen. The script is attached to the collider, and I’m checking to see if a RedBarrel rolled through it. After changing to other.name, it still doesn’t enable the light or the smoothLookAtConstraint.

Thanks for the help, Im gonna keep trying new things.