Level changing and build issue

I've run into a bit of a snag with level changing.

In my Start Menu (Level 0), I use this script to make the 'Play' button go to an opening video (which is in the build settings as level 1)

if (GUI.Button( Rect( (Screen.width/2)-70, Screen.height -160, 140, 70), "Play"))
isLoading = true;

When I click play in the editor, it goes to level 1 and plays the video. In my video is this code:

function Start(){
    function Update(){
               Application.LoadLevel (2);

Which changes the level to my main level after the movie has played.

However, when build the game and test play it, clicking 'play' takes me immediately to my main level (2).

What am I doing wrong? Why does it work in the editor but not in the game?


I have a chain of levels set up to play to go from day to night cycles.

This is the code I use to test the levels will load in the right order.

function Start ()


yield WaitForSeconds (20);


It loads after 20 seconds, but it doesn't load level 4 - it loads level 0. I've tried using the title instead of number ( `Application.LoadLevel("Night_2");` ) but this just loads the same level as the one I am in.

I am baffled.

For your second problem, have you go to Build Settings and add your new level?

Well I'm not sure what the problem was but the first was solved by re-importing the video files and the second issue vanished when I used a code to fade to an image, the the Next level.