Using sphere collider on a GameObject sphere

Hi, I’m relatively new in Unity and I’m using sphere colliders in collision detection on a Sphere GameObject. I used the following methods:

  • Collider.OnCollisionEnter
  • Collider.OnTriggerEnter

but no one is callled in despite of a sphere has collided on a plane. This is the script of the sphere:

public class Particle : MonoBehaviour {

void OnCollisionEnter(Collision collision)
    {
        Debug.Log("Entered");
    }

    void OnTriggerEnter(Collider other)
    {
        Debug.Log("Entered");
    }
	
	void Awake()
    {
		collider.isTrigger = true;
	}
	
	// Update is called once per frame
	void Update () {

	}
	
	// Use this for initialization
	void Start () {
        renderer.material.color = Color.blue;
	}

}

What I’m doing wrong?

Greetings

does the object that collides on to your sphere have a collider? And is it the right type? (See: Collision action matrix)

Well, yes, it has a “Mesh Collider” because it’s a plane. Any idea?

Thanks

Reading more depth about collision detection I realized that at least one of the particles must have attached a RigidBody in order to send out trigger events. That was my problem.

Greetings