i have multiple Game Objects in different positions and i want to move each on of them
down alone on any click when mouse enter in example :
wall position 1, 0.7, 1
wall position 6, 0.7, 3
wall position 2, 0.7, 2
wall position 5, 0.7, 5
wall position 3, 0.7, 4
wall position 4, 0.7, 6
and i want all of them in the same (x, y) pos and need to move them just on the y axis THIS IS THE SCRIPT
var OnOff : boolean;
var wall : GameObject;
var target : GameObject;
function Start ()
{
OnOff = true;
}
function OnMouseEnter ()
{
renderer.material.color = Color.black;
if (OnOff == true)
{
if (Input.anyKey)
{
transform.position = Vector3(wall, target, wall);
OnOff = false;
}
}
}
function OnMouseExit ()
{
renderer.material.color = Color.white;
}