unity get x position of transform code example Example: unity get x position float x = transform.position.x;