Hello,
I have an array of randomly generated ball prefabs.
I can check that I am clicking on any ball prefab because the ball prefab, called N-back in the picture above (with many clones as you can see) , has a script attached with this method:
private void OnMouseDown()
{
print("clicked");
}
Yet I want to be able to identify which specific ball I am clicking because eventually I want the user to click them in order trying to remember the order in which the balls were instantiated on the screen, because I instantiate them one by one in random order.
I don’t know how to identify which ball/gameObject/clone of the list created is being clicked by my mouse.
I tried to print the name of each, they all have the same name. The positions are obviously different but I don’t know how this information would be useful to distinguish the balls on click.
Any suggestion would be much appreciated