GUI Label Error

var crosshair : Texture2D;

function Start () {
Screen.lockCursor = true;
}

function OnGUI () {
GUI.Label (Rect (Screen.width / 2,Screen.height / 2,25,25), crosshair);
}

Returns, "Method not found: ‘GUI.Label’ "

Whats wrong?

shouldn’t you be using texture not label?

What? First of all there’s no such thing as “GUI.Texture”.

Second of all, if it did exist, this would still be perfectly correct and that does not explain the error.

code looks fine to me, but maybe try copying the example verbatim and see if it works.

var textureToDisplay : Texture2D;

function OnGUI () {
    GUI.Label (Rect (10, 40, textureToDisplay.width, textureToDisplay.height), textureToDisplay);
}

actually it is called DrawTexture, well that is what i use.

still an error…

Deleted the script and re-wrote it. Works fine…

Oh well