The issue is that OnMouseDown()
is only called for old style GUI (IGUI) elements and GameObjects with colliders attached. (see the docs)
What you need for this is to move your scene loading logic to another function, e.g. void LoadLevel()
. Then you set up the UI button using the inspector to call that function.
1: Add a function to OnClick
Locate the Button component on your Play button object and click the plus at the bottom of the OnClick () area.

2: Drag over the GameObject which has the script you'd like to run a function from.
In this case, I've just attached the script to the button itself. You should drop it on the left-hand box. Alternatively, you can click the circle to select the target GameObject from a list.

3: Use the dropdown to select the function
The dropdown will show you all scripts / components attached to the GameObject, then if you hover over one of those the available public functions on that script / component.
