how to get x position of an object unity code example
Example 1: unity get x position
float x = transform.position.x;
Example 2: unity how to set an objects postion x,y,z
transform.position = new Vector3(x, y, z);
float x = transform.position.x;
transform.position = new Vector3(x, y, z);