problem with guibutton

i’m doing a play button with script. This s my code:

#pragma strict

var play : boolean = false;
var texture : Texture2D;
var position : Vector2;
position.x = Screen.width / 3;
position.y = 50;

function OnGUI(){
if (!play){
if (GUI.Button(Rect(position.x, position.y, position.x, Screen.height / 6 ), play)){
	play = true;
	
}
}
}

And I get this error: (11,15): BCE0023: No appropriate version of ‘UnityEngine.GUI.Button’ for the argument list ‘(UnityEngine.Rect, boolean)’ was found.

thank you!

In line 11 you have to put:

if (GUI.Button(new Rect(position.x, position.y, position.x, Screen.height / 6 ), “play”)){

if (GUI.Button(Rect(position.x, position.y, position.x, Screen.height / 6 ), “play”))

I think you are looking for.