Hi, I try make a load progress bar, but it does not work
var Scene : String;
var progres : float;
function Start () {
var op : AsyncOperation = Application.LoadLevelAsync(Scene);
op.allowSceneActivation = false;
progres = AsyncOperation.progress;
}
It gives an error “BCE0020: An instance of type “UnityEngine.AsyncOperation” is required to access not static member “progress””
In the last line you need to do little change, as “progress” which you are accessing from AsyncOperation is not a static member, so you have to access it from object which you created.
Like this
var Scene : String;
var progres : float;
var op : AsyncOperation;
function Start (){
op = Application.LoadLevelAsync(Scene);
}
function Update () {
progres = op.progress;
}