i have an array of gameobjects set up with a 'piece.js' script attached. here's what i'm having trouble with... i want to click one piece (with an OnMouseUp event) and have it sort of 'activate' to be moved. the problem is it activates everything. setting booleans inside that script didn't help, because it would just set true or false to everything the script is attached to.
i started to store the clicked object into an array like below ::
arr.Add(gameObject);
for (var go : GameObject in arr){
isSelected = true;
}
this worked to an extent, but it then just adds objects to the array as i click them. is it possible to limit this array to 1 object? seems like something super basic but i'm at a loss.