Loading screen only works once

I have made a loading screen for my game. On here, it will show the progress of loading (I have a big scene) and it will display tips for the game. The loading screen works, but it only loads one scene before breaking completely. I am handling scene loading with the script, I call LoadingScreen.loadScene(“scene_name”) to load the scene only if I want to use the loading screen. That then sets a static string and loads the loading scene, which creates an AsyncOperation with the static string, and you know the rest. But again, this process only works once, and after that the AsyncOperation is instantiated by LoadLevelAsync, but doesn’t actually do anything. I’ve even set up hooks to detect if the scene isn’t loading anything, and there’s still problems.

Here’s the script:
using UnityEngine;
using System.Collections;

public class LoadingScreen : MonoBehaviour {

	private static string sceneToLoad;
	private static AsyncOperation async;

	public string[] tipTexts = { "This is a test message!" };
	private string tipText;
	private float timeToChange = 10f;
	private GUIStyle style = new GUIStyle();

	public Font font;

	void Start () {

		style.font = font;
		style.normal.textColor = Color.white;
		style.fontSize = 25;

		if(sceneToLoad != null && async == null) {

			async = Application.LoadLevelAsync(sceneToLoad);



	void GenerateNewText() {

		string txt = tipTexts[Random.Range(0, tipTexts.Length)];

		if(txt == tipText) {



		tipText = txt;


	void Update() {

		timeToChange -= Time.deltaTime;

		if(timeToChange <= 0f) {

			timeToChange = 10f;



	void OnGUI() {

		style.alignment = TextAnchor.MiddleCenter;
		GUI.TextArea(new Rect(0, 0, Screen.width, Screen.height), "Loading

" + tipText.Replace("
", "
") + (async == null ? "

Not Loading" : “”), style);
style.alignment = TextAnchor.LowerLeft;

		GUI.Label(new Rect(10 + ((Screen.width - 10) * getLoadProgressF()), 0, Screen.width - 10, Screen.height - 10), getLoadProgress().ToString() + "%", style);


	public int getLoadProgress() {

		return (int)(getLoadProgressF() * 100f);


	public float getLoadProgressF() {

		if(async == null) {

			return Input.mousePosition.x / Screen.width;


		return async.progress;


	public static void loadScene(string scene) {

		sceneToLoad = scene;



The scene is just am orthographic camera with this script attached, so it loads quickly and because all of the loading screen is GUI-based.

Does anyone know what’s going on? Fixing this problem is important, because I need to use this loading screen a lot in the final game.
Thanks, Romejanic

My god I’m an idiot. I know what’s happening. The async operation is static and is not being redefined -_-