Click to make Ball teleport Help

![alt text][1]

[1]:

Hi,i am trying to make my GreenSphere to teleport or move to the position where i clicked on,but theres aways got error can some1 help me check my script??

as now when i click will display the position coordinates,so i want the ball to move to the coordinates.Thx

private var hitPos : Vector3 ;

private var hitObjectPos : Vector3 ;

private var hit : RaycastHit ;

private var Down : boolean = false;

function Start(){

 GameObject.Find("Sphere11").renderer.enabled = false;

}

function Update(){

if(Input.GetMouseButtonDown(0)){

  Down = Input.GetMouseButtonDown(0);

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

  

  GameObject.Find("Sphere11").renderer.enabled = true;

  

  if(Physics.Raycast(ray , hit)){

     hitPos = hit.point ;

     hitObjectPos = hit.transform.position ;

  }

}

GameObject.Find(“Sphere11”).transform.position = new Vector3(hitPos.transform.position.x , 5 , hitPos.transform.position.z); //think this part got error?/

}

function OnGUI(){

//The world position of the ray’s contact point->

if(Down == true){

  GUI.Label(Rect(5,50,200,50),hitPos+ "") ;

}

}

I didn't test this or anything, just changing your code a bit real quick to give you an idea, you can add whatever else to it that I leave out, this is just to get your sphere popping up ->

private var hitPos : Vector3 ;
private var hit RaycastHit ;
private var Down : boolean = false ;
private var blip : GameObject ; //<--sphere11
 
function Start(){
   blip = GameObject.Find("Sphere11") ;
   blip.renderer.enabled = false ;
}
 

 
function Update(){
   if(Input.GetMouseButtonDown(0)){

     var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition) ;
 
     if(Physics.Raycast(ray, hit)){
        hitPos = hit.point ;
     }
     blip.transform.position = Vector3(hitPos.x , 5 , hitPos.z) ;
     blip.renderer.enabled = true ;
   }
}