unity get position of gameobject code example
Example 1: get position of any gameobject in unity
GameObject.Find("Your_Name_Here").transform.position;
Example 2: how to reference the position of a game object unity
private Transform player;
private void Start()
{
player = GameObject.Find("Player").transform;
}
Example 3: get position of gameobject unity
GameObject.FindGameObjectWithTag("Your_Tag_Here").transform.position;