I am not able to call a function from OntriggerEnter event :(

Hi guys am a total noobie in unity, actually am trying to add scoe when bullet hits the enemies collider. But i cant call the function from OntriggerEnter event. dont know what went wrong

void OnTriggerEnter(Collider col)
    {
        //first disable the zombie's collider so multiple collisions cannot occur
        GetComponent<CapsuleCollider>().enabled = false;
        //destroy the bullet
        Destroy(col.gameObject);
        //stop the zombie from moving forward by setting its destination to it's current position
        agent.destination = gameObject.transform.position;
        //stop the walking animation and play the falling back animation
        GetComponent<Animation>().Stop();
        GetComponent<Animation>().Play("fallingback");
        Controllerscript.AddScore(scoreValue);//this part is not working for me.
        //destroy this zombie in six seconds.
        Destroy(gameObject, 6);
        //instantiate a new zombie
        GameObject zombie = Instantiate(Resources.Load("zombie", typeof(GameObject))) as GameObject;

        //set the coordinates for a new vector 3
        float randomX = UnityEngine.Random.Range(-12f, 12f);
        float constantY = .01f;
        float randomZ = UnityEngine.Random.Range(-13f, 13f);
        //set the zombies position equal to these new coordinates
        zombie.transform.position = new Vector3(randomX, constantY, randomZ);

            //if the zombie gets positioned less than or equal to 3 scene units away from the camera we won't be able to shoot it
            //so keep repositioning the zombie until it is greater than 3 scene units away. 
        while (Vector3.Distance(zombie.transform.position, Camera.main.transform.position) <= 3)
        {
            randomX = UnityEngine.Random.Range(-12f, 12f);
            randomZ = UnityEngine.Random.Range(-13f, 13f);
            zombie.transform.position = new Vector3(randomX, constantY, randomZ);
        }
        

    },void OnTriggerEnter(Collider col)
    {
        //first disable the zombie's collider so multiple collisions cannot occur
        GetComponent<CapsuleCollider>().enabled = false;
        //destroy the bullet
        Destroy(col.gameObject);
        //stop the zombie from moving forward by setting its destination to it's current position
        agent.destination = gameObject.transform.position;
        //stop the walking animation and play the falling back animation
        GetComponent<Animation>().Stop();
        GetComponent<Animation>().Play("fallingback");
        Controllerscript.AddScore(scoreValue);// this part is not working for me
        //destroy this zombie in six seconds.
        Destroy(gameObject, 6);
        //instantiate a new zombie
        GameObject zombie = Instantiate(Resources.Load("zombie", typeof(GameObject))) as GameObject;

        //set the coordinates for a new vector 3
        float randomX = UnityEngine.Random.Range(-12f, 12f);
        float constantY = .01f;
        float randomZ = UnityEngine.Random.Range(-13f, 13f);
        //set the zombies position equal to these new coordinates
        zombie.transform.position = new Vector3(randomX, constantY, randomZ);

            //if the zombie gets positioned less than or equal to 3 scene units away from the camera we won't be able to shoot it
            //so keep repositioning the zombie until it is greater than 3 scene units away. 
        while (Vector3.Distance(zombie.transform.position, Camera.main.transform.position) <= 3)
        {
            randomX = UnityEngine.Random.Range(-12f, 12f);
            randomZ = UnityEngine.Random.Range(-13f, 13f);
            zombie.transform.position = new Vector3(randomX, constantY, randomZ);
        }
        
    }

If the OnTriggerEnter does not work it could mean you’ve not set it uo properly.

One of the colliding objects would require a RigidBody.

You may also check this tutorial:

Hello.

First, As jack says, first be sure the method is beeing called.

Second, why post all this huge code just for this question? If pretend someone to answer you delete all unnecessary information, and give the information needed you dont post, like screenshot of inspector of the object…

Bye.