Question by
ioshi35 · Dec 04, 2016 at 05:16 PM ·
colliderscollider2d
OnTriggerEnter2D Problem
Hi guys Im making a 2D game like puzzle bobble.
Okay think of this as my gameobject > OOO when the 3 balls with the same tag collide it must be destroy but when its like this >> OO OO OO OO it must not be destroy..
I do this ..
void OnTriggerEnter2D(Collider2D other){
if (other.gameObject.tag == "pop") {
if (!col) {
count += 1;
//GameObject.Find("Main Camera").GetComponent<score>().isThree += 1;
//GameObject.Find("")
col = true;
} else {
col = false;
}
}
}
Its kinda hard to do.
if the count is = 3 the gameobject must destroy but whenever the other gameobjects collide .. it adds to count . which is kinda suck . please help
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612102022im_/https://answers.unity.com/themes/thub/images/avi.jpg)