I have a cylinder using a mesh collider and rigid body. I also have 2 blocks(cubes) as goals. The cylinder's tag is "SodaCan" The block's tags are "Goal1" and "Goal2"
I created a script called "GoalDetection" and attached it to "Goal1" and "Goal2" GoalDetection uses this exact code:
function onCollisionEnter(other : Collision) {
if (other.gameObject.tag == "SodaCan") {
Debug.Log("Goal Scored");
}
}
My problem is that even when the soda can is right on top of either goal "Goal Scored" is not printed.
Does anybody know any solutions or what i did wrong?
I am using unity iphone