I have a 8 by 8 grid, X and Y axis, of cubes. I would like to find a way to select all cubes above a selected cube into an array. Is there a function in javascript that you can use to see if a gameObject is above an individual?
var i = 0;
for (var y = 0; y < 8; y++) {
for (var x = 0; x < 8; x++) {
var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.AddComponent(Rigidbody);
i++;
}
}
For an example, lets say if I click cube 40 I want to select all cubes “physically” above cube #40.