Cannot get Collider event of different object

I have a scrip attached to GUI canvas in this script I perform various operation related to game status.

Now I want to detect the hit of a bullet MyBullet to a target MyTarget I have tried o add in this script the follow code

function OnCollisionEnter(collision: Collision) {
   for (var contact: ContactPoint in collision.contacts) {
       if(collision.gameObject.name=="MyTarget" || collision.gameObject.tag=="MyTarget" )
         {
         Debug.Log("Ball hit Box");
         points++;
         speed=bullet.velocity; 
        }
     }
 }

And nothing happens

I have altso tried to create in Start function

var target=GameObject.FindGameObjectWithTag("MyTarget");
targetCollider=target.GetComponent.<CapsuleCollider>();

adding this check in Update function

if(boatCollider.isTrigger){
    Debug.Log("Ball hit Box");
    points++;
    speed=bullet.velocity; 
}

With no result.
How could I fix this?

Please note that this script is not attached to MyTarget object is attached to my GUI canvas object

Making some research before asking a question is always a good idea :

Check OnCollisionEnter on other GameObject

Note that the FAQ mentions it :

Please look around to see if your
question has already been asked (and
maybe even answered!) before you ask.