Loading scene again problem.

Hi… :)) im new to Unity. Just part of my school project !!

Just wanna ask this problem . This is it,.

we have main menu. If we click ‘play game’ basically it will proceed to the first level. In first level we have pause menu, and if we click ‘Main Menu’ definitely it will go back to the Main Menu level, but the problem is if we click the ‘play game’ once again , the scene would not function anymore which is differ to what happen in the previous. But the audio sound is still working.

just wanna know why is that happen. ? any specific solutions there please .? It would be a great help . :slight_smile:

If you mean that your script ain’t working then iv’e got a script that you can attach to any object that contains a collider and a mesh. Attach this script to a 3D Text. So i think the problem may be is that you dont have -function OnMouseDown ()-. with this function you can apply a behaviour that makes pressed button open a scene by using -Application.LoadLevel()-

So heres the script that should help you IF you’re using 3D Text and not GUI. If you are then you will have to tweak there a little bit

    var isQuitBtn = false;

function OnMouseEnter () 
{
	renderer.material.color = Color.cyan;
}

function OnMouseExit () 
{
	renderer.material.color = Color.grey;
}

function OnMouseUp()
{
	if(isQuitBtn)
	{
		Application.Quit();
	}
	else
	{
		Application.LoadLevel(5);
	}
}

Hope this helps

  • Felipe