you mean u want to get the world coordinates?
if yes then:
GameObject x=Instantiate (prefab, new Vector2(Input.mousePosition.x, Input.mousePosition.y, Quaternion.identity);
public Transform target;
void Update() {
Vector3 screenPos = camera.WorldToScreenPoint(x.transform.position);
now ur gameobject has the coordinates in screen position
↧