Basic Mouse Click Anywhere for something to happen.

Is this possible with unity 3d? I know it is, but I haven't found a solution for this yet. I tried:

function OnMouseDown () 
        {
var snowball = Instantiate(snowballPrefab, GameObject.Find("SSpawnPoint").transform.position, Quaternion.identity); snowball.rigidbody.AddForce(transform.forward * 1000);
        }

and it works only if I click the snowball prefab. I would like to make this work by clicking anywhere on the screen. Any help is appreciated. Thank you!

Yes, it's easily done. See documentation for Input.GetMouseButtonDown or Input.GetButtonDown() for descriptions and code.

It is somehow not working for me, I tried Imput.GetMouseButtonDown example, I tried even Input.GetButtonDown()... still no working result it acts like I didn't do nothing.

I made it work! if(Input.GetButtonDown("Fire1")) did the trick:) thank you!

I found this, for the latest version (today is 14-4-2019) .