ned help with a fullscreen button

ok so what i want to make is a button wich makes toogles fullscreen mode if it is pressed.
i have tried allready but it isnt working :frowning:

this is what i have so far:

var fullscreen = false;

function OnGui ()
{
	if (GUI.Button (Rect(10,10,100,20),"fullscreen"))
	{
		fullscreen = true;
	}
}

function update ()
{
	if (fullscreen)
	{
		Screen.fullScreen = Screen.fullScreen;
	}
}

Use

 Screen.fullScreen = !Screen.fullScreen;

instead of

screen.fullscreen = screen.fullscreen

still not working :frowning:

oh…i noticed that i forgot to tell you what problem i have: the box is not showing :frowning:

never mind i figured out the problem :smile: