You need to get an object, or rather its value, and id by clicking on a 2d object. Objects themselves are displayed in a loop when creating a scene, so GameObject.Find does not help, that is, it only displays the value of the first object. Rummaged all that is possible, nothing helps, gives a bunch of errors. The code below does not produce anything, and what is commented out only gives the value of the first object.
public GameObject getItem; private string str; void OnMouseDown(){ str = getItem.GetComponent<sellItem>().value; //str = GameObject.Find("Image(Clone)").GetComponent<sellItem>().value; Debug.Log(str); }