Scaling Instantiated prefabs

I’ve only just started using unity and im having trouble with making a prefab larger/smaller :-|. All i need is for a prefab to appear in a scene and when a button is pushed (later) it gets twice as large. This is a simplified version of what i have so far.

var head1 : Transform;
private var X : int = 0;
private var Y : int = 0;
private var heads : int = 0;
var headone : GameObject;

function Update(){
X = Screen.width;
Y = Screen.height;
if (heads==1)
{
heads=2;
Instantiate (head1);
}}

function OnGUI(){
if (GUI.Button (Rect (40,60+Y/10+Y/15,X/6-30,Y/15), "Add Block"))
{
heads++;
}
if (heads >=1)
{
if (GUI.Button (Rect ((2*X-45)/9,10+Y/15,(X-315)/18,Y/15), "+"))
{
headone = GameObject.Find("head1(Clone)");
headone.transform.localScale.x++;
}}}

Please excuse if my format is wrong, this is all new to me

http://forum.unity3d.com/threads/143875-Using-code-tags-properly You should state what the problem is, exactly.

–Eric

The problem is the prefab spawns but when i press the “+” button it wont get any larger :S. Btw ty for the tag link :slight_smile: