Script Not Working At All.... :) (SOLVED)

I have a bit of a problem… My Script won’t work at all! xD
I have it applied to my camera The whole Script is:

var Prefab : Transform;
function OnGui () {
	  if (GUI.Button(Rect(10,10,50,50),"Create")){
			var gos : GameObject[];
    		gos = GameObject.FindGameObjectsWithTag("SetObject");
    		for (var g in gos){
    		if (g.GetComponent.<ControlObject>().isBuild);
    		Instantiate(Prefab, g.transform.position, Quaternion.identity);
			}
		}
	}

I don’t see anything wrong with it… I even tested to see if it was working by putting: 'Application.Quit();' in the start function and it still didn’t do anything :confused: once again i have this script on my camera. Anyone have a idea on what may be causing this?
Thanks if you can help! :smiley:

well to start with, the following code:

       if (g.GetComponent.<ControlObject>().isBuild);

does not actually do the code you’d expect afterwards. You exit the if, by adding ; at the end. Remove the ; and see if this fixes your code.

Also, I’d advice you to use indents more. It makes code more clear. For example:

var Prefab : Transform;
function OnGui () {
    if (GUI.Button(Rect(10,10,50,50),"Create"))
    {
        var gos : GameObject[];

        gos = GameObject.FindGameObjectsWithTag("SetObject");
        for (var g in gos)
        {
            if (g.GetComponent.<ControlObject>().isBuild)
                Instantiate(Prefab, g.transform.position, Quaternion.identity);
        }
    }
}