Error cs0119 expression denotes a type' where a variable' value' or method group' was expected

I create a loadscreen and clicking to play I get this error: Error cs0119 expression denotes a type’ where a variable’ value’ or method group’ was expected.

Can help me?

Mi Script in C#:

using UnityEngine;
using System.Collections;

public class LoadingScreen : MonoBehaviour {

public string LevelToLoad;

public GameObject background;
public GameObject text;
public GameObject progressBar;

int loadProgress = 0;

// Use this for initialization
void Start () {
	background.SetActive (false);
	text.SetActive (false);
	progressBar.SetActive (false);
}

// Update is called once per frame
void Update () {
	if (Input.GetKeyDown ("space")) {
		StartCoroutine(DisplayLoadingScreen(LevelToLoad)); 
	}
}

IEnumerator DisplayLoadingScreen(string level){
	background.SetActive (true);
	text.SetActive (true);
	progressBar.SetActive (true);

	progressBar.transform.localScale = new Vector3(LoadProgress, progressBar.transform.localScale.y, progressBar.transform.localScale.z);

	text.guiText.text = "Loading Progress " + loadProgress + "%";

	AsyncOperation async = Application.LoadLevelAsync (level);
	while(!async.isDone){
		loadProgress = (int)(async.progress * 100);
		text.guiText.text = "Loading Progress " + loadProgress + "%";
		progressBar.transform.localScale = new Vector3(async.progress, progressBar.transform.localScale.y, progressBar.transform.localScale.z);
		yield return null;
	}
}

}

I think in the line

    progressBar.transform.localScale = new Vector3(LoadProgress, progressBar.transform.localScale.y, progressBar.transform.localScale.z);

You meant to use

loadProgress

Since this is the name of your variable

Sorry to jump on your question, but I’m following the same UnityCookie tut that you’ve used and have a question regarding it.

I get the error:

MissingComponentException: There is no ‘GUIText’ attached to the “LoadingScreen” game object, but a script is trying to access it.
You probably need to add a GUIText to the game object “LoadingScreen”. Or your script needs to check if the component is attached before using it.
LoadingScreen+c__Iterator21.MoveNext () (at Assets/Scripts/LoadingScreen.cs:34)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
LoadingScreen:Update() (at Assets/Scripts/LoadingScreen.cs:24)

So the problem here would be

StartCoroutine(DisplayLoadingScreen(levelToLoad));

What would I need to change that too?

Full code: using UnityEngine;using System.Collections;public class LoadingScreen : Mo - Pastebin.com

Thanks :slight_smile: