I have a ball that rolls around and collects coins using this
function OnCollisionEnter(col : Collision){
if(col.gameObject.name == "CandyCoin"){
Destroy(col.gameObject);
game.noOfCoins ++;
}
It works but when the ball hits the coin it bounces off before the coin gets destroyed. How do I get my ball to go right through the coin while still collecting it. I think this is due to the mesh collider, but I need a collider to detect collisions.
thanks
Ok I figured it out I needed to add a rigid body then set mass to 0