hit coin collider

I have some problem here. I have a coin and a horse. I want my horse when it gets the coin, score will be set. I’ve try to use raycast hit. but it still didn’t work. Can you guys help me please. Here’s my code.

Thank you

public class DuaRatusPoint : MonoBehaviour {

PlayerManager player;
GameObject coin;
Ray ray;
RaycastHit hit;
float range = 0.1f;

void Update () {

	player = PlayerManager.thisPlayerManager;
	//player = GameObject.FindWithTag ("Player");
	if (Physics.Raycast (ray, out hit, range)) {
					if (player.collider.gameObject.tag == "Coin") {
			
							ScoreScript.addScore (200);
							Destroy (gameObject);
					}
			}
}

This should work unless there was a reason you had to use raycast

PlayerManager player;
GameObject coin;

 // collision should give you what you are looking for
function OnCollisionEnter(coll: Collision) {
 
    player = PlayerManager.thisPlayerManager;
    //player = GameObject.FindWithTag ("Player");
              if (coll.gameObject.tag == "Coin") {

                   ScoreScript.addScore (200);
                   Destroy (gameObject);
         }
}

Or just a normal trigger box on the coin.