Hello,
I have been trying to make the objec,t that enters the object with this script, destroyed but only that object. This is my code that I have so far, but when I run the game this function doesn’t work. nothing happenes.
function OnTriggerEnter (other : Collider)
{
if (other.gameObject.CompareTag ("Enemy1"))
{
Destroy (GameObject.FindWithTag("Enemy1"));
}
}