I'm trying to detect a ball entering throw a ring in a basketball game. I am using the following script at the ring
public class Anotar : MonoBehaviour {
private ControlJuego control;
void Start(){
GameObject gameControllerObject = GameObject.FindWithTag ("ControlJuego");
if (gameControllerObject != null)
{
control = gameControllerObject.GetComponent <ControlJuego>();
}
if (control == null)
{
Debug.Log ("Cannot find 'GameController' script");
}
}
void OnTriggerEnter (Collision col)
{
control.puntuar (2);
}
void OnCollisionEnter (Collision col)
{
//control.puntuar (3);
}
}
The ring has a box collider set as trigger to detect the OnTriggerEnter method. It also has a mesh collider to detect when the ball touch it throw OnCollisionEnter. My problem is that OnTriggerEnter is not working (used breakpoint inside and it doesn't stop). Actually OnCollisionEnter works fine. My ball has a sphere collider and both use rigidbody. Any idea?

