How Do We Script a GameObject as a Child?

How do we make a prefab (var circle : GameObject;) into a child of the player in script? I can’t seem to get it right. I just need to see an example in Javascript to drop into the script below.

REASON: To show the beginning touch on touchscreens with a circle. Seems simple, useful, and wanted to share.

What I have wrote so far:

#pragma strict

var circle : GameObject;
var fTC : Vector2;

function Update () {
	if(Input.touchCount == 1){ //Does finger count on screen equal 1?
        if(Input.GetTouch(0).phase == TouchPhase.Began){ //When touch on the touch screen begins.
			fTC = Input.GetTouch(0).position;
			Instantiate(circle, Camera.main.ScreenToWorldPoint(fTC), Quaternion.identity); //This needs to be a child of the Player in the scene.
			Debug.Log(fTC);
		}
		if(Input.GetTouch(0).phase == TouchPhase.Ended){ //When touch on the touch screen ends.
        	//Code to get rid of circle/GameObject. I don't know how to successfully do this yet.
        }
	}
}

Also I watched some new Unity 4.6 UI videos, and sadly starting to learn more about using GUI Textures instead of sprites (what I am doing at the moment is using sprites). Is there a really big difference? Is it better to use a GUI Texture over a sprite in this case? Why or why not?

Try this:

#pragma strict
 
 var player : GameObject;
 var circle : GameObject;
 var fTC : Vector2;
 var circleclone: GameObject;//don't fill in the slot in the editor
 
 //function Start(){
 
     //player = GameObject.Find("Player");
 
 //}
 
 function Update () {
     if(Input.touchCount == 1){ //Does finger count on screen equal 1?
         if(Input.GetTouch(0).phase == TouchPhase.Began){ //When touch on the touch screen begins.
             fTC = Input.GetTouch(0).position;
             circle.transform.parent.player;
             circleclone = Instantiate(circle, Camera.main.ScreenToWorldPoint(fTC), Quaternion.identity); //This needs to be a child of the Player in the scene.
             circleclone.transform.parent = player.transform;//makes the parent the player
             Debug.Log(fTC);
         }
         if(Input.GetTouch(0).phase == TouchPhase.Ended){ //When touch on the touch screen ends.
             //Code to get rid of circle/GameObject.
             Destroy(circleclone);
         }
     }
 }

All you need is one Transform.parent

Check the code below:

 #pragma strict
 
 var player : GameObject;
 var circle : GameObject;
 var fTC : Vector2;
 
 //function Start(){
 
     //player = GameObject.Find("Player");
 
 //}
 
 function Update () {
     if(Input.touchCount == 1){ //Does finger count on screen equal 1?
         if(Input.GetTouch(0).phase == TouchPhase.Began){ //When touch on the touch screen begins.
             fTC = Input.GetTouch(0).position;
             circle.transform.parent.player;
             GameObject circleClone = Instantiate(circle, Camera.main.ScreenToWorldPoint(fTC), Quaternion.identity); //This needs to be a child of the Player in the scene.
             Debug.Log(fTC);
            // This line makes the player gameobject the parent of instantiated circleClone game object.
            circleClone.transform.parent = player.transform;
         }
         if(Input.GetTouch(0).phase == TouchPhase.Ended){ //When touch on the touch screen ends.
             //Code to get rid of circle/GameObject.
         }
     }
 }

Each GUITexture requires one drawcall but you can actually reduce the drawcalls by using sprites like it is done by SpriteManager which packs sprites to reduce draw calls. But since the new GUi 4.6 does this job of packing sprites to reduce draw calls for you, why not use it? Plus it has various great features that you can use with few clicks.