get 2d object y value unity code example
Example: how to change the position of a gameobject in c# unity
Vector3 pos = transform.position;
pos.x = 12;
transform.position = pos;
Vector3 pos = transform.position;
pos.x = 12;
transform.position = pos;