How do I use Destroy(gameObject) on the instance without destroying itself?

Hey, thanks for the help.
I’m using Destroy(gameObject) with a onTriggerExit to get rid of my projectiles that are outside the game area. Problem is that after the first projectile that gets destroyed, I get the error saying that the gameObject im trying to access has been destroyed.

I’ve tried setting my projectiles to static as well, but not really doing the trick.

Any suggestions on how I could use destroy() more effectively?

CHeers!

Maybe something like:

function OnTriggerExit(other : Collider){

 if (other.gameObject.tag == "projectile")
    Destroy(other.gameObject);
    }

Sometimes, the OnTriggerExit function relates to the OnTriggerEnter function because of the parameters that can be used. When it comes to colliders, be aware that your answer may be found in related functions

i ended up having to create a couple tags and switch to one of them as the projectiles fired, then used the destroy function on the switched tags.