how to change position of an object to the another object

i want to change position of two object…
means they interchange their position and the movement is seen in scene view
anyone who know please help me…

static var object1:Vector3;
static var object2:Vector3;
static var object3:Vector3;
static var moving:boolean=false;

static var check:boolean=false;

static var next:boolean=false;
var speed:float = 5.0f; 
private var weight : float = 0;
var liftSpeed : float = 1;

function Update () {
    if(check) {
        check=false;        
        startPosition =object1; //Set the start 
        weight += Time.deltaTime * liftSpeed; //amount
        transform.position = Vector3.Lerp( startPosition, object2, weight);
        transform.position = Vector3.Lerp(object2, startPosition, weight);
        next=true;
        Debug.Log("update one ");
     }                          
     if(next){                            
        transform.position = Vector3.Lerp(object3, object2, weight);
        transform.position = Vector3.Lerp(object2,object3, weight);
        Debug.Log("value of start "+startPosition);                 
        Debug.Log("value of end "+object2);  
        Debug.Log("update two");
    }
}
function OnCollisionEnter(theCollision : Collision){
   if(theCollision.gameObject.name == "Glassfour"){
      Destroy(gameObject);
      object1=GameObject.Find("Glassfour").transform.position;
      object2=GameObject.Find("Glassone").transform.position;
      object3=GameObject.Find("Glasstwo").transform.position;
      Debug.Log("Glassfour orignal position "+object1);
      Debug.Log("Glassone orignal position "+object2);
      Debug.Log("Glasstwo orignal position "+object3);
      var position1 : Vector3 = object1;
      Debug.Log("after Swaping ........");
      object1 = object2;
      object2= position1;
      check=true;
      Debug.Log("Glassfour changed position "+object1);
      Debug.Log("Glassone chenged position "+object2);
      //startPosition =object1; //Set the start                  
   }
}

these are both applied to the Transform of THIS object:

transform.position = Vector3.Lerp(object3, object2, weight);
transform.position = Vector3.Lerp(object2,object3, weight);

they kind of cancel out

you may want something like:
    function Start()
    {
    object1 = transform.position;
    object2 = otherObject.transform.position;
    }
    function Update()
    {
    transform.position = Vector3.Lerp(transform.position, object2, weight);
    otherObject.transform.position = Vector3.Lerp(otherObject.transform.position, object1, weight);
    }

this example will swap two objects, I think that was your question…

ah yes, now I see…

you’ll need to create an additional var for each object you’re swapping:

var glassFour = GameObject.Find(“Glassfour”);
var glassOne = GameObject.Find(“Glassone”);

then use

    glassFour.transform.position = Vector3.Lerp( startPosition, object2, weight);
    glassOne.transform.position = Vector3.Lerp(object2, startPosition, weight);