unity change z position code example
Example 1: unity set position
// To set the position of a gameobject use the following
GameObject.transform.position = new Vector3(x, y, z);
Example 2: unity get quaternion z
Quaternion.eurlerAngles.z
// To set the position of a gameobject use the following
GameObject.transform.position = new Vector3(x, y, z);
Quaternion.eurlerAngles.z