Clones destroying each other.
Hello, I'm having a problem only destroying a single clone during an OnTrigger event. What I'm trying to do is have one clone "absorb" another where during the onTriggerEnter it will destroy the other clone. But they just end up destroying each other and I can't find a way around it. They both are from the same prefab so i can't filter by tags and names don't work either. The code is very basic.
void OnTriggerEnter2D(Collider2D other) {
Debug.Log(this.name + " is destroying " + other.name);
Destroy(other.gameObject);
}
The debug when they collide says "Object A is destroying Object B" and "Object B is destroying Object A"
Comment
Answer by IST2TC · Sep 21, 2015 at 02:30 AM
Never mind. I ended up just giving them a size value and comparing them to see which one got destroyed.