Hello, I’m new here and sort of a noob at scripting although I’m very interested in it and have been going around google looking for things to help me with my game. Well, everything’s been going good so far but something won’t work.

function Update () {

 if(Input.GetKey ("mouse 0"))
 audio.Play();
 Application.LoadLevel("jenny");
}


function OnMouseEnter() //when the mouse hovers over the object
{

renderer.material.color = Color.red; //the object will glow red 
 }

 function OnMouseExit () //when the mouse isn't hovering over said object anymore 
 {

renderer.material.color = Color.white; //the object will turn back white. 
}

-----End Script--------

So When I try click the ingame object, the audio plays but the next scene doesn’t load. I’ve already made sure my scene was built into the game in the build settings. A little help.

Make sure the name of the scene is jenny.

If it still doesn’t work replace Application.LoadLevel(“jenny”); with

Application.LoadLevel(1);

Where 1 is the number of the scene on build settings. (0, 1, 2…)

Your if statement needs some braces…

if(Input.GetKey ("mouse 0")) 
{
  audio.Play();
  Application.LoadLevel("jenny");
}

This says “if mouse 0 is pressed, execute the two lines inside the braces”. Without the braces only the audio.play was being executed.

That brings up an issue with your LoadLevel call though. Your current code is executing the LoadLevel every frame. Seems like it would just continue to load the same level over and over. The question is, is “jenny” the name of a different level than the one running this script?