- Home /
collision combo
hello, i need help in setting up a collision combo script for my game. i have one gameobject which is flicked into a particular direction, and pops balloons that it hits. i would like that when this gameobject hits two balloons at the same time they both pop and the combo prefab is spawned at the point that the collision occurred. this is the collision code:
var pop: GameObject;
var burst : GameObject;
function OnCollisionEnter2D(coll: Collision2D) {
if (coll.gameObject.tag == "burst"){
Instantiate(burst, transform.position, Quaternion.identity);
Instantiate(pop, transform.position, Quaternion.identity);
Destroy(gameObject);
}
}
please help. thanks a lot in advance.
Comment
Best Answer
Answer by mealone · Sep 20, 2014 at 05:30 PM
solved this problem by changing the collision to a touch collision and using circlecast.