Error NullReferenceException android

Hey,
I have a script here, and when I drag it on an object called GemPrefab, it gives this error and I don’t understand what’s wrong with it.
It’s used for my adroid tablet, that when I touch it, it plays a sound, destroys the prefab and add 100 points of score.

#pragma strict
var PingGood: AudioClip; 




function Update () {

    var hit: RaycastHit;
    var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
        if (Input.touchCount > 0  Input.GetTouch(0).phase == TouchPhase.Began) 
    {
        if (Physics.Raycast (ray, hit, 100)) 
        {
            if(hit.collider.gameObject.tag == "GemPrefab")
            {
    audio.PlayOneShot(PingGood);

    Destroy (gameObject);

    ScoreBoard.SCORE = (ScoreBoard.SCORE + 100);
            }
        }
    }
}

This is the error: NullReferenceException
UnityEngine.Camera.ScreenPointToRay (Vector3 position) (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/UnityEngineCamera.cs:291)
TouchScript.Update () (at Assets/scripts/TouchScript.js:7)

I don’t understand what’s wrong. Hope for your help! Can’t get it right for weeks!

Looks like you destroying the wrong gameObject. You need to tell it to destroy what you touched so try Destroy (hit.gameObject); instead.

Edit: unless this script is on the gem you trying to destroy, then you might need to look at doing it a different way.

I still can’t find it anywhere. Can somebody just give a tutorial for android which just does this code, when the object is touched.

audio.PlayOneShot(PingGood);
Destroy (gameObject);
ScoreBoard.SCORE = (ScoreBoard.SCORE + 100);