"GetQualityLevel" is not a member of "QualitySettings"

Hello guys, basically my problem is that i’m creating an in-game Menu, with “options”, “start game” and all that sort of things, and in the “options” tab I have a general quality setting.
But my script isn’t working, I read the Unity Scipt Reference page regarding all the Quality scripts (SetQualityLevel, GetQualityLevel, Increase and Decrease);

Here is my code (really simple):

var qualityLevel = QualitySettings.GetQualityLevel();

function Update () {
	GetComponent.<TextMesh>().text = "Quality: " + qualityLevel;
}

And then I attach the script to a Text object, but i get an error from the compiler, saying that “GetQualityLevel” is not a member of “QualitySettings”.
WHAT IN THE WORLD does it mean? It’s clearly written in the Reference page that to return the quality level you need to use that variable (Here is the page), am I doing something wrong? How can I make the script say what graphics setting I have?

If I use your script I get

GetQualityLevel can only be called
from the main thread.

If I move the call to Awake it works nicely.

Do you have #pragma strict in your code?

The following works for me with no errors.

#pragma strict

var qualityLevel;

function Awake ()
{
	qualityLevel = QualitySettings.GetQualityLevel();
	Debug.Log(qualityLevel);
}

I’m pretty certain, that you need to declare var qualityLever as an int. Try out:

var a : int;
    
function Start () {
    a = QualitySettings.GetQualityLevel ();
    Debug.Log(a);
}

Also it’s an integer, not a string. It’s best that you use this when assigning to text:

GetComponent<TextMesh>().text = "Quality: " + qualityLevel.ToString;

Also, remember that you need to call QualitySettings, only in functions like Awake and Start (I think).