ON trigger enter

I want my character to enter one object and t ogive me 1 point for each passed object after this the object is destroyed .

Here is the code (What is the problem with it?)
/
/
using UnityEngine;
using System.Collections;

public class Points : MonoBehaviour {
public static int scorePoints = 0;
void Start () {

}
void Update () {

}
void OnTriggerEnter(Collider other){

		if(other.name == "goal")
		{
		scorePoints += 1;
		Destroy (other.gameObject);
		Debug.Log(scorePoints);
		}

}

}

You must specify that the name you’re searching its a gameObject.

         if(other.gameObject.name == "goal")
         {

Anyway you can search it by tag too, in my case it works when I do this searching by tag.

         if(other.gameObject.tag == "goal")
         {

If OnTriggerEnter doesn’t work make sure you have a rigidbody attached or it won’t work.