A little help?

I tried this but the object will not appear on the screen, what did I do wrong? My game is where you are a ball and you have to roll around to collect coins that spawn in random places.

void OnTriggerEnter(Collider collider)
     {
         if (collider.gameObject.name == "Player") {
             Destroy(this.gameObject);
             SpawnCoin();
         }
     }
     void SpawnCoin()
     {
         Vector3 position = new Vector3(Random.Range(-10.0F, 10.0F), 1, Random.Range(-10.0F, 10.0F));
         Instantiate(coin, position, Quaternion.identity);
     }

You are destroying the object this script is on before you call SpawnCoin();. When you destroy a GameObject, all components attached to that GameObject are destroyed as well, so the SpawnCoin(); method no longer exists and doesn’t get called. Move that function to before the Destroy();

Also, with this code, the coin will only spawn when the Player actually collides with whatever object this script is on, assuming the object has a collider on it.