collision detection points

hello!
when my player hits an obstacle i need it to subtract points from the initial number of points that there are.
This is the script i have so far, it is attached to the obstacles. The problem is that it skips over the ontriggerenter method.

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class TriggerScore : MonoBehaviour {

    // Use this for initialization
    public static int score = 24;
    GameObject horse;
    // gameController;

    void Start ()
    {
        //gameController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController>();
        horse = GameObject.Find("Horse");
    }

    void OnTriggerEnter (Collider col)
    {
        if (col.tag.Equals("Horse"))
        {
            score -= 3;
        for(int i=3;i>0;i--)
            {
                horse.GetComponent<MovementController>().speedOfHorse=4;
            }
            horse.GetComponent<MovementController>().speedOfHorse=5;
        }
    }
   
}

Try adding a RigidBody to the horse/TriggerScore objects and make Kinematic true.

Make it read col.tag == “Horse” instead.

Or change OnTriggerEnter to OnCollisionEnter(Collision collision).

Do what @Stardog said. Here’s an additional tip.

// Use this, because apparently it is (slightly) faster
col.CompareTag("horse")