LoadLevelAsync Causes Unity to Crash?

I’m trying ot use LoadLevelAsync for the first time, in Unity Pro 4.1.5f1.
The following script in an empty scene, attached to an empty GameObject, causes the Unity editor itself to hang, every time.

Does this happen for other people? What am I doing wrong? This looks OK to me…

using UnityEngine;
using System.Collections;

public class SceneLoader : MonoBehaviour {
	string targetScene = "MainGame";

	AsyncOperation asyncOp;

	IEnumerator Start() {
		// Load and wait
		asyncOp = Application.LoadLevelAsync(targetScene);
		asyncOp.allowSceneActivation = false;

		yield return asyncOp;
		Debug.Log("Load complete!");
	void Update () {
		if (asyncOp.isDone) {
			Debug.LogError("Done Loading");

	void OnGui() {
		if (asyncOp != null) {
			GUI.Box(new Rect(0, Screen.height - 40, asyncOp.progress * Screen.width, 40), "");

It seems without the asyncOp.allowSceneActivation = false; line, it works. I wanted to start a fade transition on load complete, so I don’t want it to swap scenes for me.

Remove the

asyncOp.allowSceneActivation = false;

this does load the level but never activate your scene (actually finish loading). You cannot abort a loading operation since the objects in the current scene are being unloaded.
Remove the line or set allowSceneActivation to true somewhere.

asyncOp.allowSceneActivation = true;

To have a fading in the new scene you have to setup the overlay on the new (the loaded) scene and then start the fading from there. It is not possible to finish the scene loading without allowSceneActivation (this blocks the loading at about 90% if I remember right).

Hope you understand me and it helps :wink:

edit: the fading like you do it now, does it not work without allowSceneActivation = false; ?