Using LoadLevelAsync to load a level in the background , but initiate the level changing after something is done

I have an introductional video as the first level of my game.

As it plays , i want the menu level to be loaded in the background , but only change the level when the video is done playing. I currently have this which does not work.

var introVid:AsyncOperation;
var movieTexture:MovieTexture;
var canLoad:boolean=false;
function Start(){
Debug.Log("level was loaded");
function OnGUI () {

function LoadLevelAsynchronously(){


What am i doing wrong here?

I know this is a really old question but as I came across this when searching for something else I thought I’d answer.

It’s basically exactly what I asked here and the answer is that you can’t use LoadLevelAsync to choose when to switch levels. It will load the level in the background but then switch as soon as it is ready.

You could use AssetBundles to achieve something, as pointed out in the above link.