get object position unity code example
Example 1: get position of any gameobject in unity
GameObject.Find("Your_Name_Here").transform.position;
Example 2: get mouse position unity
Vector3 worldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Example 3: get position of gameobject unity
GameObject.FindGameObjectWithTag("Your_Tag_Here").transform.position;