Hello. This is the script for a bullet in my game
function OnTriggerEnter (other : Collider) {
Destroy(other.gameObject);
Destroy(gameObject);
}
Is there a way to reference a specific collider and give it a unique function? Currently, this destroys both the bullet and whatever it hits. I want to make it so that when it collides with the game object “wall” it references the " Destroy(gameObject);" function and not the “destroy other” function.
Thank you.