OnMouseDown creating text boxes

Hi all,

I am new to unity and trying to create an informative architectural walkthrough.
One where, the FPC walks through a level and can select (OnMouseDown) various pieces of architecture and learn more about them. (have a text box appear)

I am having trouble making this happen.

I have a bit of code

private var showBox = false;


function OnMouseOver () {
	if (Input.GetMouseButtonDown) showBox = true;
}
	
function OnGUI () {
	if (showBox) GUILayout.Box("A classic neovictorian turret");
}

, attached to a turret with a collider and I want a textbox to appear when the user clicks it, however currently the text appear on MouseOVer and then does not dissapear once the mouse exits.

I am sure it is probably an issue with my bool but I am having trouble making the GUI stuff work.

Thanks
K

You also need an OnMouseExit function that sets showBox to false.