cannot destroy my bullet

i am trying to destroy my bullet when it hits a tree in my game but it just will not work. in the same function i am destroying the bullet when it hits the enemy but it will not work on the tree. this is the script im using:

function OnTriggerEnter(other : Collider)
{
   if(other.collider.tag == "enemy")
      {
	     Destroy(gameObject);
	  }
   
   if(other.collider.tag == "tree")
      {
	     Destroy(gameObject);
	  }

it works for the enemy but not the tree. i have checked the tag many times both the enemy and tree have the same components except for scripts. i am lost as to why this wont work but hopefully someone can shed some light on it? :slight_smile: oh and by the way only the bullet is trigger, iv tried mixing that up but nothing worked.

I am pretty sure trees are part of the terrain unless you directly added them as GameObjects. I dont think there is a way of directly destroying trees that belong to the terrain outside of the inspector. So you might want to add the trees as gameobjects seeing this will most likely work.

in case you already did that, make sure your tree has a collider attached to it.