Gui position to mouse position not working [solved]

Hi, all in the title really.

The rectangle keeps staying at (0,0).
Not sure if I’ve done something wrong, or I need to go about it another way…

Thanks in advance,

	static Rect myRect;

	bool showBuildMenu = false;

	void Update(){

		RaycastHit rayHit;

		Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);

		if (Input.GetButtonDown ("Fire1")) {

			if(Physics.Raycast (ray, out rayHit) && rayHit.collider.tag == "Zone"){

				Vector2 mousePos = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
			
				Vector2 convertedGUIPos = GUIUtility.ScreenToGUIPoint(mousePos);

				myRect = new Rect (convertedGUIPos.x, convertedGUIPos.y,120,80);

				showBuildMenu = true;
		
			} else { 

				showBuildMenu = false;

			}

		}

	}
	
	void OnGUI() {

		if (showBuildMenu == true) {
			GUI.Window (0, myRect ,DoMyWindow, "mywindow");
			}

	}
	
	void DoMyWindow(int windowID) {
		if (GUI.Button(new Rect(10, 20, 100, 20), "Hello World"))
			print("Got a click");

		if (GUI.Button(new Rect(10, 50, 100, 20), "Hello World2"))
			print("Got a click2");
		
	}

Tested this out after lots of debugging. For some reason I didn’t need anything like I had at all, a simple input.position did the trick… Wonder what screentoguipoint does however… that didn’t seem to work.

Anyhoo,
Here’s just what I used to anyone who comes across this

Vector2 mousePos;

	static Rect myRect;

	bool showBuildMenu = false;

	void Update(){

		RaycastHit rayHit;

		Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);

		if (Input.GetButtonDown ("Fire1")) {

			if(Physics.Raycast (ray, out rayHit) && rayHit.collider.tag == "Zone"){

				mousePos  = new Vector2(Input.mousePosition.x, Input.mousePosition.y);

				myRect = new Rect (mousePos.x, mousePos.y,120,80);

				showBuildMenu = true;
		
			} else { 

				showBuildMenu = false;

			}

		}

	}