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?
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