Hello people of Earth and Mars.
I am making my Game Menu - I am actually making it to improve my knowledge on scripting so far I am doing great! However I have ran into a problem that the internet has no answer for and I have spent about 6 hours straight and still can not find an answer for.
So here is my problem:
I want a level/scene (“MainTerrainScene”) to be loaded when a series of events happen. In this case the series of events are. When the cursor (DefaultMouse) Enters the text “New Game” (Box Collider : 3D Text) and whilst inside the text you click the left mouse button; A new scene called “MainTerrainScene” will be loaded.
I have tried everything I know of and the script works fine when the function is update and not “OnMouseEnter” however therefore the cost of not having the mouse to enter and then click is paid.
Here is my current script:
function OnMouseEnter()
{
if
(Input.GetMouseButtonDown(0))
{
Application.LoadLevel("MainTerrainScene");
}
}
The Code is in JavaScript.
Thanks for your time in reading hopefully you will have an answer for me