i made a script where by clicking on a cube/button it moves how do i make it so that when i click it it moves a nother cube not the cube that i clickd pls help here is the script:
var speed : float = 0.2;
var timer : float = 0;
var player = this;
function Update (){
if(timer >= 1)
//here is the line wherei would like to move a nother cube
{
this.transform.position.x += this.speed;
}
}
function OnMouseDown () {
timer++;
}
function OnMouseUp () {
timer--;
}
i would like i tthat when it says:
this.transform.position.x += this.speed;
it would move a nother cube pls help tnx