function for find x position in unity code example Example: unity get x position float x = transform.position.x;