Loading Screen

Hello everyone,

I’m trying to implement a loading screen. At the menu you press play. The loading screen appears. I’m trying to implement a flag blowing in the wind but instead a black screen appears. About nine seconds later the actual game loads. So, the functionality is there. The problem is that I’m getting a black screen. Here’s my code:

#pragma strict
var async: AsyncOperation;

var movTexture : MovieTexture;

function Start () {
    async = Application.LoadLevelAsync ("Stampede");
	yield async;
	
        renderer.material.mainTexture = movTexture;
        movTexture.wrapMode = TextureWrapMode.Repeat;
        movTexture.loop = true;
        movTexture.Play();

}

function Update () {
	var progress = async.progress;
	Debug.Log(async.progress);
}

My movTexture is a file of a flag blowing in the wind.

Any help is appreciated. Thank you for your time.

Just flip the order of when you play the movie in Start ought to do it. The way you have it now, you yield until the level is loaded, so your movie never gets played.

function Start () {

        renderer.material.mainTexture = movTexture;
        movTexture.wrapMode = TextureWrapMode.Repeat;
        movTexture.loop = true;
        movTexture.Play();

        async = Application.LoadLevelAsync ("Stampede");
        yield async; 
}

Detailed Unity3D Actual Loading Screen Tutorial (With free C# Script and Demo project)
http://techscenarios.com/2019/01/unity3d-add-loading-screen-to-your-game/

Or watch it on Youtube