I’m working on an RTS style game and have the following script for selecting objects:
Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if(Physics.Raycast(ray, out hit, Mathf.Infinity))
{
//Handle Input.
}
However, due to the nature of the game, I want the player to be able to select from a group of objects which are placed at the same transform.position, some of which are hidden with a boolean value.
I want the player to be able to click on the stack and then select one of the objects which isn’t hidden.
Where’s a good place to start with this?
Many thanks!