I’ll use an image to try and convey my problem first.

KEY
Red: Turret
Blue: Cannonball
Green: Turret Sphere Collider
What I’m attempting to achieve here is to make the Cannonball destroy on exiting the Sphere Collider.
This is what I have so far:
function OnTriggerExit(other : Collider)
{
if(other.gameObject.transform == myTarget)
{
myTarget = null;
}
}
The ‘myTarget’ is for an object moving in and out of the collider. This is so that the turret knows not to aim at ‘myTarget’ upon exiting the collider.
I tried adding:
if(other.gameObject.transform == myProjectile)
{
Destroy(myProjectile);
}
but it didn’t work.
myProjectile is of type Transform, as is myTarget. I tried messing around with the “is Trigger” options, to no avail.
Any advice?